Message ID | 20241213122523.12764-4-shikemeng@huaweicloud.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B0E7E77180 for <linux-mm@archiver.kernel.org>; Fri, 13 Dec 2024 03:27:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FC1D6B008C; Thu, 12 Dec 2024 22:27:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C488E6B009B; Thu, 12 Dec 2024 22:27:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A759B6B008C; Thu, 12 Dec 2024 22:27:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EA7536B0092 for <linux-mm@kvack.org>; Thu, 12 Dec 2024 22:27:19 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8DE84140C09 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 03:27:19 +0000 (UTC) X-FDA: 82888498392.17.32B5FFF Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf28.hostedemail.com (Postfix) with ESMTP id B58BDC000C for <linux-mm@kvack.org>; Fri, 13 Dec 2024 03:26:46 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734060420; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z4BbOlZEkt/W5xNHqln4dcqe6CQrwVZO/98XAp4h3Sw=; b=ZVc6ix7Dxj+Jz6ifMnfE/B81E+loVtqmSzXMuShqEB7OhjTG58krX6g2zBWKJbePKcbEVU TAihBqNQORojQoKZn8aqnUSgSObgHNt3zk7FHvlbdsMOqPgYGsb9CW9Wg5IVGMm1Lmljc+ MLs1oZNajwhZs8eVhb1KWDKTJvXGESk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734060420; a=rsa-sha256; cv=none; b=Bz9lKE0JZmvC2E8CYHhEpKqS4i5P3krQpLzJwL4kAr7NNzFODk28u3dWdw5GGQEUcP6wFX W33u/YoyZeSctsAFhNHVENWbS2ifUek2rXJ1Gww+hWtJIKYslojF4YNSodrg1o7g1lrpI8 rTaAtv/T8DvZgs/ppQHNc1eb0JJqeh8= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Y8ZWZ1D7kz4f3lDK for <linux-mm@kvack.org>; Fri, 13 Dec 2024 11:26:50 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 8234C1A0568 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 11:27:10 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP4 (Coremail) with SMTP id gCh0CgBHcISMqVtnfJ3KEQ--.55430S5; Fri, 13 Dec 2024 11:27:10 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: akpm@linux-foundation.org, willy@infradead.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 3/5] Xarray: distinguish large entries correctly in xas_split_alloc() Date: Fri, 13 Dec 2024 20:25:21 +0800 Message-Id: <20241213122523.12764-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20241213122523.12764-1-shikemeng@huaweicloud.com> References: <20241213122523.12764-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBHcISMqVtnfJ3KEQ--.55430S5 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1rGr4kJF1DCr4DJw1fZwb_yoWDurg_ur 4FgF4kZr45GF4kXwnxCF4rt340kFn0kF9ruFWUJr9xW34UJrsrtr1kWrsrXa4rAFyjyFy7 AFs5Jry093yUKjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDxYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84AC jcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrV ACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWU JVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_JF 0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AK xVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrx kI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v2 6r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8Jw CI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUaTKuUUUU U X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam05 X-Stat-Signature: 4ceuw7drhj1bd7zcw3nehc9wb1xurs6a X-Rspamd-Queue-Id: B58BDC000C X-Rspam-User: X-HE-Tag: 1734060406-765870 X-HE-Meta: U2FsdGVkX1+fDOkiuaoLpRdcivQKNBialKzTKnUkruHpzJlBGwTl92+g57whkyxU2K+gT/C6WGWBvFtsfKD3SOxwoSeA5UeUAbUZwO5IUP4rCziUA4oiMaMveO1T0PutpdEBJEysNhF8QEPGr4OXDrb0sQQQrrgMr+uwh0dSMRWHQWQ1VNIZWiZlPU6lqLdQ2rk91wOGWZC6KMyN6TxxhTHY4kWfGd3cmiaP4PPSi0WvqUOWgtovKj0b3cWXTA54MfP9/uA1QwrT2za6IEWl8QHiM9BX7dFphqp1VoAfQgHISwfSJMssx/uoT2fGKunekfL5ZP20tTGohaqAn2/o2asomH/cNH9kej6f/oUS+A/38dcWpLVtzEJzN+M8yn82/DPDP4uMii2UR6iCu4Hd65yTG7M2FGkrTllnk0YcL/6RsDHRGM92jv4OLuWLkgZaJRzUW+1uIOTmYC/+cDN+H8NZrnz4nA3XyS+YtDsliFkYwfr5iYm4Uajd2FQy5QCAM+Cd9erOwEJTSiwTvMWX9OaTQv/aBekn5FZ7sUey+08IipZ1xD+Ynbo4gPzYlYrXy1DLUy37mrBB0m95qq+g1gGNfory7dF+nEnj3QWTZm3T+ORm581VA1+mm03jPLwVgtBRWtW4TgrBCcWEOaKltHmylcEegXUvbwiHH0OwYiMCPQaLpr/7D9Pc6jq4X2yamkNXV2SSZVEVXrvnmD5m6xzyYvd7OjJDRGNraYDJ6qPBBcH2IK4mGsn9SZHsbc0p8pF1oPNzfoF4FnI/808dk+OD7dRgi+TZqKLKyI7Ow3lwy69aw2pyGBqvSwXmNWDLeYuuYuOtGxUsxsWNyqhJCIPVDpXGtv5csE61yisCwx8gfYsldHQlwb0FwwFxLNNEc5bCL70B5Gw519VDZAbYVwVaJJORw+dSZx0vckN7WzcGCOxnp6AMB+H8R1qwH6auVopYiynWxoFegh2JycS F+gPrBj9 CjaDJrRbLTqEwO+TQNNuQAoVAbDXYFGD1NfCEx4Bu6nIIm/P+eraqNvNwt+x8YsBR0oCeSbsDag6kjPD2ELcdeJ7dAqZWzWOU25VvUxEK2BY18B2l3+W285cXZ/Y7JpfrC61HYSJz2T7RsGMHgDgalHp8tD4Taep81mqvZ0r5pI5KsgasVEchuerVtKabPEN2JMMpOyr0cpCPN62B0euhjsA/yg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Fixes and cleanups to xarray
|
expand
|
diff --git a/lib/xarray.c b/lib/xarray.c index d0732c5b8403..3fac3f2cea9d 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1022,7 +1022,7 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, unsigned int mask = xas->xa_sibs; /* XXX: no support for splitting really large entries yet */ - if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT < order)) + if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT <= order)) goto nomem; if (xas->xa_shift + XA_CHUNK_SHIFT > order) return;
We don't support large entries which expand two more level xa_node in split. For case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order", we also need two level of xa_node to expand. Distinguish entry as large entry in case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order". As max order of folio in pagecache (MAX_PAGECACHE_ORDER) is <= (XA_CHUNK_SHIFT * 2 - 1), this change is more likely a cleanup... Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> --- lib/xarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)