From patchwork Mon Nov 11 21:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13870701 Return-Path: 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 00165D2E9E4 for ; Mon, 11 Nov 2024 12:55:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB1866B008A; Mon, 11 Nov 2024 07:55:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84EBF6B0088; Mon, 11 Nov 2024 07:55:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DDE36B008C; Mon, 11 Nov 2024 07:55:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 15F7C6B008C for ; Mon, 11 Nov 2024 07:55:08 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C3675AC9E0 for ; Mon, 11 Nov 2024 12:55:07 +0000 (UTC) X-FDA: 82773807396.13.EAC6616 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by imf20.hostedemail.com (Postfix) with ESMTP id 08C501C0016 for ; Mon, 11 Nov 2024 12:54:11 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 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=1731329533; 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=AvN8u3WWaJBIVDWP+6egm58xZqsw2NfS5dOoXYLl3U0=; b=IPpfy9jdBaFtnAzNX20IrbocaUg3SV2Wqw121xHeVq2zNm4zqxSX5oIsMsg0FPnX8+ox/p /ZvyP03mmbPQ3SpFhWUBq+q6uw7/PSv2kBHrpQM9Pjr5DzDhIU8YGRg9dOgl6X/A3K1vrR dxh785Qpv2ZuORQ2HnEGcm12CK0IEZA= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731329533; a=rsa-sha256; cv=none; b=6EpAPjsiVaM3RNj2RlxD2lNNerRz+7oCxyKtXOHNChp9ulwUhqcYU+bzADQ1z+F3VtYkit /OxfYmyl92zdxu/TS4NwvL34IXyE+MG27Y91VHEZN3BRYRg2tt3P5iNHmv3z3huiiEUeC2 EwhgM//1dEfEzITrQ95qdnBXp+WYvZo= Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Xn8dV3N2Fz4f3jd6 for ; Mon, 11 Nov 2024 20:54:38 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id A12A31A0359 for ; Mon, 11 Nov 2024 20:54:56 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP4 (Coremail) with SMTP id gCh0CgB3n4Oe_jFnllryBQ--.36628S4; Mon, 11 Nov 2024 20:54:56 +0800 (CST) From: Kemeng Shi 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 RESEND V2 2/5] Xarray: distinguish large entries correctly in xas_split_alloc() Date: Tue, 12 Nov 2024 05:53:56 +0800 Message-Id: <20241111215359.246937-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20241111215359.246937-1-shikemeng@huaweicloud.com> References: <20241111215359.246937-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgB3n4Oe_jFnllryBQ--.36628S4 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1rGr4kJF1DCr4DJw1fZwb_yoWfZFc_ur 1FqF4kZrW5CFs7WwnxCFsYy34FkFs0kF9ruFW8JF9xW34UJwsrZw1kWrZrWa4rAFyqyFy7 CFs5Jry093yjyjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r15M28IrcIa0xkI8VCY1x0267AKxVWUCVW8JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxV WUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jhxhLU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 08C501C0016 X-Stat-Signature: nxaxhjrqnrud7fqdjsmajceztwbguu5x X-Rspam-User: X-HE-Tag: 1731329651-254975 X-HE-Meta: U2FsdGVkX19cdXzJT6djPjdnE63CWHzp7c2L2no5DMgN0GlGT8DkVmzzL0dzADZMDGSUwQ7VaZNt1aXOSXVGe0kx6cpkwX6a8F1oFroBafzyLpGE/BMemwovqL21lOSmB+y7cWQr4gyOYSsVTmdREQ6jWrTvTfDItfOdZG6mQso18kQq5dY4fXaspLvViAcG2BiT6VZ9pxoOs6JGFnS7ND1ERnRzVYhwJ87VgJMj5VnBs+KbcbgdRqLiWRNil38b1njJaR0vjOPZvx2Vw3cGTCjpDG0U25NEaM+uWjnzsBWyjHVnGhPY34OygNf+GdL0Z9HCVtGOID4pCYT0eUKtUowJEfOx8d4Dts024urO1zooTL6ByVnnDM3IGCgX4RqBH3KVIWYfA4WImObRGUcRK4AGzzCS7tORyqfglXKcxkncIEIiiEFNx7lCFEX/bgjzd2QJiy43WR7GyR3CzqbWZq/YPvv+anR/EzVrJXId1wUPoMqioIuPCOLYx7J6thcdz+TA2O8qgm5QrP4T04t755ENz07f27rtxhUar+SLvSyjGjMnJU2RRtePl4k0lyH2IabfNXRGE7mRnCCNZVKdpFDDYTBvSDvG3KgEe+9JPCkGuYfTnjDPiq95PzjlxaRGC2u3izXNsz/b3KvoB7ctymL4X1quEuJ7rNpWnvWolY9Vbcuyy1Br22YgjMjd8nv2mcrX7T3aLjuIrWVhy+2+YY6Qi6FAtKkCEPlzDDjx6mXEAZvq/7Bl3FXUCaT/RoD3UWjxK+s5oUcdxjtjyKiw1WSgglwjl0imOOhPgifvG1Yg8tlDQ6n6bqEE3H1avit/tCC3mTaLMQAfwLn/0qXggw9ksNiJxXHdUqJJrICQdzerbT/CJRWMFbJ1CZWRN+I3TYeRPMnkzvO4trZwtLQcpHdhq0TblM7N/xfwhfAkFB5OL46YrjfLOdNyfYr+pjRcQVWgjhHF34nfE0B5Rqd yN+U2VVO vMevIv5C0z1JDVAjkf4OcHrdpM0Riq4mWxpeE4FLjcYjA+kv/8dSUMZzPQcUD02Sq/WUPHKcjwsu7HD38OtRwg8luuS8qia9FwgIcPmNqHdh0mmH6Q4W2lr96L6Yg+2NJwCm/1AzfNs4PamA5pKsdFLZRh0dLmKPJrSjaIUlKf7kILzwyeO2AHYqcpLqs1KsNoabRyBPBHysMYJYD5B5rCD/Z2O5KTyeM6SydXV8o/cy58FdFCJUkWpbkeCB3XmBnt9DWiH88GGmu8/JJRbqv4CLvRD1fl5PGYTXerrkeGQwyh5P6qDvdG0/k6DrpYVlJ1Llx 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: List-Subscribe: List-Unsubscribe: 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". Signed-off-by: Kemeng Shi --- lib/xarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xarray.c b/lib/xarray.c index fa87949719a0..b9fd321a02ad 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;