From patchwork Sat Oct 19 02:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842540 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 B3D38D3E1AC for ; Sat, 19 Oct 2024 02:37:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37F5A6B009F; Fri, 18 Oct 2024 22:37:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 309FA6B00A0; Fri, 18 Oct 2024 22:37:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 184FE6B00A2; Fri, 18 Oct 2024 22:37:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E63486B009F for ; Fri, 18 Oct 2024 22:37:30 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6276D1C515E for ; Sat, 19 Oct 2024 02:37:16 +0000 (UTC) X-FDA: 82688790114.01.99ABC61 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by imf16.hostedemail.com (Postfix) with ESMTP id 3492F18000C for ; Sat, 19 Oct 2024 02:37:16 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KFNNPwPQ; spf=pass (imf16.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729305374; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=Jx6ql30Rr7ZGGutsXY5/Qe08rpu2wxuP38RHd5eAMEY=; b=x8pfxTtafkrkIEPiO3Y6/oTFHizljB6hDyyB9G5lyYbT0O5hIp8xIJK+YEw2/O56NLyJh+ +GgFrMmdkE6v7Kw3cPvfdL4lK3k4bBz98lXvMvYyN26UPQfk+vrOgZCg7XqT8x7wZHMVyB Rnx8RPSlQGv82TnFH6h6tKc0l7JhAnU= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KFNNPwPQ; spf=pass (imf16.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729305374; a=rsa-sha256; cv=none; b=RZ6I6wWzmQwWA1cEBnEEDtqs6jfBGGtxrFGkd2ZvwwGOnp8FF2VHOsOFOKoT5BKaZzFGLo CcZLpHV0+kE4aCgIYt0O1Vb4a4K3WsVz6pVxrB7XjHYQ0ToGep5H68ht+J+G6Tmr90bHD+ fhTqT8JbkkzplhFtWDTvV+AfNkn1Bi0= Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-430ee5c9570so34720245e9.3 for ; Fri, 18 Oct 2024 19:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729305447; x=1729910247; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Jx6ql30Rr7ZGGutsXY5/Qe08rpu2wxuP38RHd5eAMEY=; b=KFNNPwPQDsS2dNxTK+1r1M4GAP9SCYidCUgfE1il8j6+MNQlRFlyN3TNKwMJW99jZH IEZ2zD0vNJczUVP//IbGUkJ1HZH0fozRnEAuAOf9nhnDTXyy1DpWNw8VvCfJ44LptOfC Z+9wIPtFcYrPBnWta+BDf+G3qRA40z8HJ3p9NTy8lBQE3edIMbuv+AVY+TrXSU7Mn5VD VE6GsdadgxcObolxT0VYJ9ttw1l5Zc7RjUgU50SD9YPKek7xqg1svwbevE+ZEKDtxbdA KUHyK5RnFrhJxp4zWnYfoagCnVGoYBW1Po8F1/PbxP6m0PRJ3vVkIwnfKo9VR9oY6H56 z4rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729305447; x=1729910247; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jx6ql30Rr7ZGGutsXY5/Qe08rpu2wxuP38RHd5eAMEY=; b=mHzln52RVw5qWQdaMtJJuRvzx4COsUv/xVjleVF9OcgKP0FxlXsyMpFJcJ5iz4Kv2l ljTbSxcmlJe6WN9WGmacfyQwfh21m6BwAJUnWew1X4GHdKC6GuLLQvNUx0UWuE/gA0E0 QQpNBYd3DF5iQUbwM/5BLhFCROTQ3pOh/U3PYQoMnPqL8JJvWuUyKNheD4bbmYq4u25/ pZY6LR+haT5s2vqpKJCyO5iDur0CYE2tx+bxyI9w5jKEMEZ64ORs8loMTAsFOQ8/IwNL HOxubNhDyTKIqEuZnHeRjaTC0z/XqGaHS7JRaksOX4BACKdxBwmsWAJfDy6mFGyU+q29 JvIQ== X-Forwarded-Encrypted: i=1; AJvYcCWQw3ZFBz6npFlSMYzwZIk1juYl0Ou+TDbXuuAEYUKTE1on4kR1oaBCgdPGKfy9WWAf3ZcmxsJA9A==@kvack.org X-Gm-Message-State: AOJu0Yzq+Sd4KvYytav2tmwgEwSrNxysIE463GfE1Y9OmzeR1+noAQfo bDteusNA3nRh3QBRaPJ77+hEqBaNKroUJSe1WvdRUU+XSxmDuvA4 X-Google-Smtp-Source: AGHT+IGIHZkEoFqLWfqtGRFgQmOc/J5heOsC9fAcjW/+zZ16nr4IesZJpB/0P7/fzIeAQ0jTAp8sNA== X-Received: by 2002:adf:f84d:0:b0:37d:4b26:54ca with SMTP id ffacd0b85a97d-37ea21d8635mr4140684f8f.14.1729305447209; Fri, 18 Oct 2024 19:37:27 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e763sm160919566b.23.2024.10.18.19.37.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2024 19:37:25 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v4 1/5] maple_tree: print empty for an empty tree on mt_dump() Date: Sat, 19 Oct 2024 02:37:12 +0000 Message-Id: <20241019023716.4516-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241019023716.4516-1-richard.weiyang@gmail.com> References: <20241019023716.4516-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 3492F18000C X-Stat-Signature: jxdfnpmxok8yzpz3kiar8m778rz6ewfi X-HE-Tag: 1729305436-776392 X-HE-Meta: U2FsdGVkX18+YLsCW0Gqj/skZ+U++1hKOGUANq0VPXLj401YyRmnMOXe+0ggdCwQvsrOEKoI4P8dzuHlJiX2oQkZ0Bq5/SrbmYgnRNny7v6eO+s+9Fxh2nGQCXhjq7s3x/7GAFqptCtVEgDblSFxNoIP1AC4hA4itlaSBau0SnIcW9OWLSmwh3Aa+XTeOcyKeAsV3w2AocOIm5JQo1gmfu8lnN2iGucszYwxLTphnKyg+5locrwl4EEqCEeEKyQXNb6Y83nqm34waJnTnBVFGG/WXzRl7+H4TupZ3UNYZjpfHmdhSeUH2tVdANHlVwpal4LDGUqw4v1e9H9M2GT333nncrgsZIN3bs0bZhwd8MUWeIptHrxuIwDPaX6VtKkpgWgi2HDwSkJL+iG0D165cpZ/RXmpzqR7OzlkO2Zd9mDaXI4laRIyPmwLPO/y2+nDV3dhgMfnIOErYn2dFjMSV1MXqkysW3zoHqXcOPHbpZN2/Dt/GSvGkCvXP8n6mTlRzN/JkKi5kXxnCdPRCWGjIsRwDivirb1DFxRy50YUHoiA4g+YdV2HvGMs2al9VOFmZE/z1ilPbeYBgoa/OwVr+RU5E+id1qVYFeq/G7ob1RpMAD1OMFOzgbLQVkFGbGXYF2ztwUbvWAYV4vSBq9MRfrVziYTQC8wPf/ccEatujB9+aJQvkSV/dL53/Z+soIfEzfywnTLzmT2ZBoWbjmxuTd0c1R3IHKfz+YI1iWoayjJc/ntg35Zptswq3xIYFP1aJF+kW5n4yxVj/wGl4uv07FHppLnrLj2lgnfjX58fy0ukFuqpm4N8t5/l/Ogihk36fLfLPR40TGtosnBUz0Ytc+DQQGFhN/bqfmhPllM/lH7Q+LAw4GN55bjHViVl4zFMpGHHrhYtXjfVmnSnWMQvvk/2mfVbDurKyHUJ1AihtbHpTvZ8qyPePOeaRlOZshCFiU8AS05pTLaHxSf5nk1 TeaI8ZsX TBcH2jv808OEE94UKhIM40mZbOFSjyTQGL1j+ugKWSvI/4Tf1g9KHS1Zk9RGoFHx4hLUoDeFOVOa0AKsY65Xdsple+0aPn7tkza6JxaP66kKJqBaiwcw6wAJl6u7wlLy+7OjOD1DhbuTesgOLsx1gbYQmy1keWiNZGjwA/CRwHbzBrJwBLkvsnpomSojK3/oWG+HJEix6LAzpuEvMivr7H1Pu2Yg+2+oljW+x/h2hPaWfiwoVV7spVNjP8eaCwgHZBtOoei7rWpvJcuI7xeEyqTTf4CGQ/Waxj93jDaaXYUtqFTiXcDUCsfbOBb8rmGcVFvbaIras74sNX3uYxv7GYRGyquQGgGDMz+vzboEJZKiML0Bm+fH8F6GFlJMaVskVNPOqrwisx2JvRrAyfNXkfDJhIeKC8mOCttAAFv7W6q3qvJckRNtXOpGdfeg3avwfC4BNIpA5PH2OZESYK8cAgDuuGgH0AM17KknaLIg6w1n6gGUju3a37TqAh60zoRYJH4wp X-Bogosity: Ham, tests=bogofilter, spamicity=0.000044, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Currently for an empty tree, it would print: maple_tree(0x7ffcd02c6ee0) flags 1, height 0 root (nil) 0: (nil) This is a little misleading. Let's print (empty) for an empty tree. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3619301dda2e..21e6895b7aef 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7287,10 +7287,12 @@ void mt_dump(const struct maple_tree *mt, enum mt_dump_format format) pr_info("maple_tree(%p) flags %X, height %u root %p\n", mt, mt->ma_flags, mt_height(mt), entry); - if (!xa_is_node(entry)) - mt_dump_entry(entry, 0, 0, 0, format); - else if (entry) + if (xa_is_node(entry)) mt_dump_node(mt, entry, 0, mt_node_max(entry), 0, format); + else if (entry) + mt_dump_entry(entry, 0, 0, 0, format); + else + pr_info("(empty)\n"); } EXPORT_SYMBOL_GPL(mt_dump); From patchwork Sat Oct 19 02:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842541 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 CA3F9D3E1AC for ; Sat, 19 Oct 2024 02:37:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5080A6B00A0; Fri, 18 Oct 2024 22:37:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48F236B00A2; Fri, 18 Oct 2024 22:37:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E1E66B00A3; Fri, 18 Oct 2024 22:37:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 099226B00A0 for ; Fri, 18 Oct 2024 22:37:34 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 86C331405E1 for ; Sat, 19 Oct 2024 02:37:20 +0000 (UTC) X-FDA: 82688790660.29.C56A85C Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by imf09.hostedemail.com (Postfix) with ESMTP id 675D5140002 for ; Sat, 19 Oct 2024 02:37:23 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZNuk1reE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729305290; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=QXW4zdNeCQqVZrqhFgxaQp0ar/9tkoSK5Km9ybE7Vp8=; b=DHW1w5BBYsDmtTpOrD0pCq13pZxXSA4bXHdubWF6BSn37owisqCb+kcfJuDTjqVanox3oq d6DEQ0VUybO63hrpMQP5Dp7dgRyui0llF+PTP1hKNqailbz1u0lxqsSYl9meqYn0EBq4gh Iz438FVeJH1hrtJKwEB23wxdFVbm/U4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729305290; a=rsa-sha256; cv=none; b=QCwF/GD0Z4rye3s1Dj343q13+tdqJhRDC5v+ZHbX46jv2KWWoiCFPz9FqA8ifzE1qZ4dNc ZGH/TmljlFA3EmlEM7+IJRwyrs28lqKC3meY+EhpAD3C8tmFmC2dJfSE7HMelXpkvA9eps NRj4tG6QdMkZ1jEgufaV5vPylKsdwog= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZNuk1reE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a99ebb390a5so708042366b.1 for ; Fri, 18 Oct 2024 19:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729305450; x=1729910250; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=QXW4zdNeCQqVZrqhFgxaQp0ar/9tkoSK5Km9ybE7Vp8=; b=ZNuk1reE75kAonjr1K0z0T8cy0+DJZyO3t4DEZB27VjUmkRZE5+l6HNsNWU7D3uvvq mD0DcNe4x5Qi0WKpW+UzC3ElKYtQPHiD6YxhO7dTQ6/d5vzJ+vd+RgR5tS0ssSud6y8B ra/6oMZaRZv8GBZR+ps3i7y9KpfnT+++JlHcuKXNOWQqwpWWnHDA9zXJoabBOVyBlin7 eDnTbINcNxxNZFYvfuS/mKQq/fGgJPWtMeUMxITb/Jdc4sFb1rdC+h1iR4Y0sxjGJOQB P/DvisL9ssRZdljZKgdSNK0Eyvm1V6egk6N/e+sv2XSQyy7wLwX11U4vFN/ItSJ0/wMB 9SsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729305450; x=1729910250; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QXW4zdNeCQqVZrqhFgxaQp0ar/9tkoSK5Km9ybE7Vp8=; b=rIvLhzk27HZkyvBBuXMseV3Ib540C4BKn8FVsqXvZiPtwGlqwDIcNFhQBjj33x/Gr/ ZBfbWLU+or4Z2muLmNU0CJ8wkO9En6geIV7RkA+hy9OAau5kIQ8p91uuKGSiF3l0wjyb eaV4Pw069JyELyjgSB9L4ioEx2GkE3wENmxGm2St/HwCr2qKTiuEeKdg0rQnKNqK7ZyL 8X2s8PZFR2QNgFUKdRhlo7hB4R5fUp/uQ1UNEyIIQVMzl6oVOt28eY2QVPEwMdOcQeN6 gmqKq4098R3KBncn3DMVFeQVDSRAmWvoAvpN3ie+D1PbtVPkTKmD9CJoQC7J2QUYsD69 M5Mg== X-Forwarded-Encrypted: i=1; AJvYcCUTGyqc2S4o5tITvvic/lLkZ8vFV0yVMbQ/LIbWzs3l6h7aERY6zKw6pWD3J5Wey/o+kgLlFN505w==@kvack.org X-Gm-Message-State: AOJu0Yz2bp4kftbmGox0mW5gHeFCHCcdqmXrk8ahw6yuAYB9jOmgaKgq BjBVT2dq8i76gSkiOfnx+dEz5K5lDMlB+YdusN6ueN6vf+uVfa/Y X-Google-Smtp-Source: AGHT+IG1Yl/u26kPrLwEn4ZhGOoteYtKwImuuVOFXyePhWmUwZ0+zlvqW8Tbu/eGyNpRA7mcb1zcPw== X-Received: by 2002:a17:906:730b:b0:a99:d587:6046 with SMTP id a640c23a62f3a-a9a4cc58f60mr752923466b.32.1729305450348; Fri, 18 Oct 2024 19:37:30 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68ad4e0asm160303166b.53.2024.10.18.19.37.27 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2024 19:37:28 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v4 2/5] maple_tree: the return value of mas_root_expand() is not used Date: Sat, 19 Oct 2024 02:37:13 +0000 Message-Id: <20241019023716.4516-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241019023716.4516-1-richard.weiyang@gmail.com> References: <20241019023716.4516-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 675D5140002 X-Stat-Signature: drrrpfojqt7wac7srg8879fdi45y1zqj X-Rspam-User: X-HE-Tag: 1729305443-880209 X-HE-Meta: U2FsdGVkX1/jQnv93uCRSSvv9BZoWHGgtlAyuKfdSnz/k7fOhh32gKqyA4CIAQVUtRpJj3bpjIn1tRPfRZwz7/KnEPQWzeGzn6Leb3R2WT4LOhSOVxsilzSgvHZI5M0Fn0t1VtNEUFL3RWx7/lBxB2+PzomeXg2UCzCo+Fcv4wa5lV3Nv6KHxM17OfF2kCcfgFHdteWNZAGw7ots0bBLgh3Tr0SRltI7DN7RkgmROctTZ9W5G3HVn+f1M6wjZz3NV1WkLhRTZRIaQNMqh7dfdE1j/IL+bue0AOmWzlTwPccNQz3uJBpM/SCottb+mFvnyCD1Z/qUBiLdvbNSAMzO8xBopdmhle8yJh7BVnfZhTPXdMNGDc5yWCtCsUsFvTpd11Sj+thO7eDMEzvZ0EnJ1OAUjjhsBinQ80l2hSM4617ppy3bZiMvHc+56r+W6OfrzB96rKpA+N7J2erFXMqlnqVzfW26zznfgpGtDASPjlrBhHMZIeh0bj/YkU/mFU5JdAZQj/S8oKDkrlWhSSfoNNVMAfo6Qdfoc5VQmaf5lZPbBuRLHu+HX464P6pkKbwv5dMk3c/S5LCuQoGPuGmqXVWOJCz2gt7HTzpzZov0itZI7AArFnjXc4h4OzjJohYadXChzA+Or5FIfTPU+eFAlmwuve+vMDPq6/Bbq7dKCdMtRcdPWey6SIogZoDLsqhxv3M1aF7kcpOdZ6693pbFuDVLAJ70EHHisPJKND86vLxIfRW7K3wfuRJYPI1dwEpcf8LR4Btkvs70/YQ8QbdLJ/xsrksue73Ox0/RH+1aUPN5MOBIhcS9sy+uqCST1D8OPJwt5mWxz1M+sInUG1AYhw8p6s6qwEATvjuhTYef8jjpyo4HV5H4E3S26hSA6/aPpb2ULavA2guJjSXA4e4dMzhUV3How0zeCK2tU97A0gkM3O91VfZ7AqMXEV88gGSb9LXmW3fhFyj8idEgClG pnMhpBpO TKk2rv7fdyUbThh5HqgnnnGcZfruTNf2b718A7hRkTFPnbxueBgbuLpP5Iz5npcK9FbhNa5aUOOmpnYHKOiZeuHR94qb7M9vXT4wokrH8HdDqWORx/47Xbx57pTmp1Ym7buPL79L4ymQbYBixPovnjJNsSnQlNqeh8naStlLsPWlyIPmcKheBufvNOlKXaRt4CuZs+BM0MAV43xwLZ87eJX86eaDuQnTx9TSctkQyb7t45uH6OXmuvPcwDMWfyyBiu/nFfY6YUSBNsCsU4zqvMsRo19o9w7RhmRvAVkAGzC7ZQzqaw7DJf+NKu9ol/gjvtlCNdGLggqfhsREKCWURxSzmOxbwO9OYnV1cCUCs0l5KqeHmIwbEWa46DIcEQIK3ABg3/ccWVGB2w4pXk2csra940BUr9vs5bfqw7qkR+5QfBu/e5lbBUJCXkL0rDcShHHFMN4yhM/Txq4QPwXPZ5e7qNzg/xeIMLCUTAbstRYLx/bbOw1BdmfbWWnb+qZ7xAfej53kVyjhUwd9vV/carQZu2dgmgpkm3CZx X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: No user of the return value now, just remove it. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 21e6895b7aef..517ddf2950e6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3400,7 +3400,7 @@ static noinline_for_kasan void mas_commit_b_node(struct ma_wr_state *wr_mas, * @mas: The maple state * @entry: The entry to store into the tree */ -static inline int mas_root_expand(struct ma_state *mas, void *entry) +static inline void mas_root_expand(struct ma_state *mas, void *entry) { void *contents = mas_root_locked(mas); enum maple_type type = maple_leaf_64; @@ -3436,7 +3436,7 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) ma_set_meta(node, maple_leaf_64, 0, slot); /* swap the new root into the tree */ rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node)); - return slot; + return; } static inline void mas_store_root(struct ma_state *mas, void *entry) From patchwork Sat Oct 19 02:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842542 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 4270AD3E1A8 for ; Sat, 19 Oct 2024 02:37:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE4896B00A2; Fri, 18 Oct 2024 22:37:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B6BBE6B00A3; Fri, 18 Oct 2024 22:37:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BEBC6B00A5; Fri, 18 Oct 2024 22:37:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 716326B00A2 for ; Fri, 18 Oct 2024 22:37:37 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DD5751C33DA for ; Sat, 19 Oct 2024 02:37:22 +0000 (UTC) X-FDA: 82688790702.18.EA9BEEA Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf30.hostedemail.com (Postfix) with ESMTP id 1B01880006 for ; Sat, 19 Oct 2024 02:37:12 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=T1eE5srb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729305406; a=rsa-sha256; cv=none; b=1Q8l9+2nHVmlZKgtwKru9Y12OIbJGOPGHt5vtatvI4rofGMgJXxCBAB4MFFjGu/Y9XigAz BWWnNvFIDT6EcNj4b/82EUjUa4QxaAadpjX2o4PD/nO62P9Ulhdpb8TcJdHajewkBnlu+U +Ce4STdPZuikPjOk8vhpBdACWmJBkj4= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=T1eE5srb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729305406; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=F5Pzm20CYLcjkNnwSf7ys9x85AzpiNweIdnMFQp1ato=; b=pdHuueHgJD4JZ0vu0JHhOw5iUscE69c1ZKyxYQTXb5HbJmQpq5RsO8hzFd6nWuvT15016t 6l3LeNFYuHtxxpDObIZLu/lganY+y986aF+7gvXRIS5iCSFhmOutryFjCZrJRt7ZbUDKoY AIHi7nOJeGYG2hJwTrg2waC0xNr3N2c= Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5c99be0a4bbso3574348a12.2 for ; Fri, 18 Oct 2024 19:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729305454; x=1729910254; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=F5Pzm20CYLcjkNnwSf7ys9x85AzpiNweIdnMFQp1ato=; b=T1eE5srbEXaI1sTronms+4XtEb9GxHfOp104rmJWdEYo9UJ9uf2bVoFW9MJGTdfMDT SvmR4XNe0pOCObP5ehqa8nH5TE7zr7d86+atGzJkdGyg4sI3oOZvDMsVhz31tP6J1aWN QUQ2SXu4JBPesgMtNwe2tkwfQ5PqjPu9QdD1uy3VTnhFW1O6nbnND1AZ7ixpWVAxDwAm npeuA3jZ686n2d4ue7ZpTdXVvX2KrqOCcynO25+ENHOGy/AaDDrjQOL0f89aWQNk1oX6 BrSXjWdxoBDoSMsnMo6eXAECrqm1qAgaNZzvWwztKhswd5refAck8dpn1zEuPZbk9IrH eLLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729305454; x=1729910254; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F5Pzm20CYLcjkNnwSf7ys9x85AzpiNweIdnMFQp1ato=; b=LMbf+ammDgRPdeB/BlIASi4jsoW53/GPSNiYpp8xHXgZUlMa6vooc8YO3fjP0vHz8U W5qRwKjEFGvzUJPy81w/fuz8x/YjWMMUUo9j32GExX2V5mksDPyqn85mqcA/3Sjk/Xrg LumIgjBeOVrRNO3c/E6fUg6067qPRsMsoOaO+GxhWNeJy8LkWMUF5biUPbxteMWq4pPm wBPmicmRjlN3RA/MrpiMVuJIkjJLkTa0mXJLMihdizjvcUtVvalYql2aW3917YN98OfZ ySY7FwGZPHxYeCuwWAlcFoCZclOgP2n9hWYlDP71Bwqc68qXTcLhA+oqrwSTuoFLAgF3 M+Iw== X-Forwarded-Encrypted: i=1; AJvYcCUjdmI7vFKF5GnhqV/Sa7BY9V5j44VDKTuKisfro3gEE/1b/FLYg6gSbj4KIjSy1G8h+jnKC66DCg==@kvack.org X-Gm-Message-State: AOJu0YxqvdXl8B4Tlvd7epwPQ9qNeyZohmOp0hpoU4C7mWvSdFnIaUL5 5vb8iNFQ2oDOQyUS9Mm3Nx/cHmoQSjfvQgyXRPfgGXexO/Zy5r0p X-Google-Smtp-Source: AGHT+IHu9X0Z+YUkSJVe22qVSw4mTGqj1epsJT0iS5Cf31pA+3aA+1hwE1XKT7zCE9TUXGggxuFdIA== X-Received: by 2002:a05:6402:524c:b0:5c9:5bb0:72fe with SMTP id 4fb4d7f45d1cf-5ca0ac62789mr3511556a12.15.1729305453583; Fri, 18 Oct 2024 19:37:33 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ca0b0e6f82sm1337882a12.62.2024.10.18.19.37.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2024 19:37:31 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v4 3/5] maple_tree: not necessary to check index/last again Date: Sat, 19 Oct 2024 02:37:14 +0000 Message-Id: <20241019023716.4516-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241019023716.4516-1-richard.weiyang@gmail.com> References: <20241019023716.4516-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Queue-Id: 1B01880006 X-Rspamd-Server: rspam01 X-Stat-Signature: twgtbaxaub7fcrtdt8ex43yhz6tczw7y X-HE-Tag: 1729305432-787878 X-HE-Meta: U2FsdGVkX1++Ylk1+oZREFjaxQpYuFBDlY318oKHSef7zhusOLcAb5F3JNI6kK+OsLPF3MXOefr7AFH8W/0jpk90hjtHB/p14hLu3uBPniEc/me0/p4TmKdU4iy88fbdrXIrSruVcC+TY+oIrvYR0fNa3A6nzdwElYrblsEzoavGZkVTshC5/PRKxA3hOgWd6lMBAp1N+OGgE4+z0G39InlD0GHH4N/VW67lFlK4vD+Ly1H6gQAtEuKV3/CcOogZ+zQEP9LG858QVxyUCcnh/1rAs5im0iIvfxK+wEiYmKONbj/8FYUnV8ru57NTeosYbNXJVYJSr52nCL/U8ghds/KaC8QJb7eeqi6+lk1iM3C6Y7Sc89z+QhlTzXgksvHgbehll1MJotD5XTaKHXbVwUlCIYdQ6lV+s1NeXQEVTeAFOrXNmtK5yZ0n2n3De5Cf5OSXT2SKjg1Nl93bVk84VotKxQYaBdPhEyINxFi5Vfs391eH4znX4IWKOq4lK0nQqX1CdK8j2I11H4AWTrszlA6vLpe8OLFIj8SPIiL3NGhPkNh/361H2mKXwfokcVvNBLluUnv0h043OXtQalnapuLH0/Smm3DE/MiFF53VHuQx/S+K86WEvqhAIdDBPc5Xcyny1JQqyPNXAyclLn47GDBBI6H99RM+gXu/b7+1pvNFF6k2sedo35XmQA8fC/6hwyXKG5GwnFLYoYyFkEr8/BCLsvZkITtZ6bN27m3yj0Iq0oBdMtSMy3AdPyY5f9OI5AlqO/BAP79PDcrDNJe9atDYHZkgjuPXwwb6txQO2r79DcbgRjvkZTHyPYUgqWHfOhitsYJNLkj+hv0f+bUNAAOKm+BD9T8rjTq8xYRuZb5GcVUU+l7UTnjuoTyqTEmXMVwrLZ9R47ReRUT+cEKqwxblhSxYSL3Tk9+8cQAvhihnXKV4qp46eA9WkyL2fhDQjQGtp8t4C/nQAx7Dun1 U7NtCkGa 1rW+c9giGudzcB0P2wCfatE8ur+txla2gw6nCRJPyDJpQgwpT9ZbfyozXg6Dai34Y6YOqgM8Los6JyvWXMbKWwPpxRZEGZFS+mX8mre0G7MLrAzPgsCGjSjmFkRJo6iJ58okR9UETrduXBFnz8N/ZXjoWUZOK6xhfvdVvMNlQcaWLWrfWwZmPN9sYG53KfyugTJRUxtFQUPci+B7qwrzBvkWg7h85GqNJ/LNu4WrgO7HfpnUuuowfe9Gdkfodw0gxPH0vX1FUsx5q9DINlFx5f2Sqf16y9HDSAs6tRkdqCUxhh2ycmhBAk5lcKDn4zcbHeaTv2+I+T0J3+JRXY3K47WPY0fa5iSssko8wAK5hlwell6zhK5Q0vxKFDRNBRoyut1esKYQC/hAvCpDPCqdshnVeCO2M+k1Ipvzh4Kl31cunrHVn7zSeFOGGk6lQL2odO+MOTnicYBcyJHeUbZghnnL2hpBQjeS+bho1JEbvszeRpD/+eFO5GnZ9+6U94miuAeZ3 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: Before calling mas_new_root(), the range has been checked. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- v4: add WARN_ON_ONCE() to check mis-usage. --- lib/maple_tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 517ddf2950e6..2226e77c00cb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3662,7 +3662,9 @@ static inline void mas_new_root(struct ma_state *mas, void *entry) void __rcu **slots; unsigned long *pivots; - if (!entry && !mas->index && mas->last == ULONG_MAX) { + WARN_ON_ONCE(mas->index || mas->last != ULONG_MAX); + + if (!entry) { mas->depth = 0; mas_set_height(mas); rcu_assign_pointer(mas->tree->ma_root, entry); From patchwork Sat Oct 19 02:37:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842543 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 149FFD3E1AC for ; Sat, 19 Oct 2024 02:37:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FE136B00A3; Fri, 18 Oct 2024 22:37:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 885BD6B00A5; Fri, 18 Oct 2024 22:37:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B1636B00A6; Fri, 18 Oct 2024 22:37:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3F9C96B00A3 for ; Fri, 18 Oct 2024 22:37:40 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 20ECA802A1 for ; Sat, 19 Oct 2024 02:37:29 +0000 (UTC) X-FDA: 82688790534.13.06B8479 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf21.hostedemail.com (Postfix) with ESMTP id 8BED71C0006 for ; Sat, 19 Oct 2024 02:37:15 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QPUZeo7B; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729305311; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=ILIvXac03VpEeGiJ70TROZ/Uw1YlHeBhyIST3O8KQTk=; b=Y/XCC2VSU9Dn0zL/lqo1LH6Kq0myI35Cuts/Q7vg0WI5vnt8/3B+hP7aBzXgkPW59dMxRU zqNvEbIu89omFaVdY0ftjMq8UU6yuWN9FDfspRaDl9Hd1dMDjhXD8H8Bx1iVWWmxcovciK V6B8RjRWemQvoHPnheS5EUMFC1xrClo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729305311; a=rsa-sha256; cv=none; b=YnqlWt/8WtaJT9Udp3qPf2sM0A/kWl7fLDdWgY+6W8OmJL+aa2Jt7XdVCI2jHrDI6mV54K I4UTPr5W+OYQsuSiC7XK9lHIHXC+7x4NF3PEUS9jhX6Ddu9JwWDGZGQ84xTFPWMzqQxrA0 l2VUk6mKzAW9A9aa/7nupbJ0wGHy2gc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QPUZeo7B; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5c962c3e97dso3077692a12.0 for ; Fri, 18 Oct 2024 19:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729305457; x=1729910257; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ILIvXac03VpEeGiJ70TROZ/Uw1YlHeBhyIST3O8KQTk=; b=QPUZeo7Bi72nzov2avNq9guyQHuLNy2V4OHcdRsPWQllJ0yQe40un3QAbIFWVZ2s83 ypOSuTIfSEo03vLEvEvyknWsYnr/EMf3NM0pSZ6xPcoUmUjZIwD+MQhQN70/pvYOJWbN U5XOZ9WaC2qAmvJx03+sT4s4KHBEMtxzCiJ68TPzDY2Va+UqktWHj/WgvqnuZ9Bh1kpK R42X23chHMx2k2kyR+jmpVLhW/bJLOMUKCY7jOaZ8bSdk6F8NK9FsDpRey/gKurK4TK7 MxH3zdbJcT+XJHpR3soKiLxie3J/+DzvkEqmtAbKt2F6bzLeLg3z8v86fuavfYIg9nwZ i2OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729305457; x=1729910257; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ILIvXac03VpEeGiJ70TROZ/Uw1YlHeBhyIST3O8KQTk=; b=uOmktMIVQDSwZGrmLS7gciXkTwwe54BfbSD+KRUd7J+L6QiQUaixR0qASaFTHvfR+C 7cEHYu2jB9MaBwio64sRILUDrDyfQLzm5ll6211wpGp7PvSKHMa9SFfh6y/Jx4dCgyXy HDwyxOLjjapNee+L7A4HKzeNv4hJguOnRio6z+gic1SGJWiy+O4yGcdiJKSZ3yrbyuM/ ZwUqRkQqzVuzXlYBEQm8EoTcBo0K8176TlWlbaYlYMC0EX+vUrVGuIL3cZpHehiH6w/8 R/RUvceLeBSZAoMbN8jWm4JsB8VlunjBSH1THK8bnJ5e1m6tH7JLQsX1+2ZGm87/PgOF ED9g== X-Forwarded-Encrypted: i=1; AJvYcCWP2MH0V2afLKn0pZKXmyeq9nvbuZtvSEWZCiogf6bJFqRpJJILgEvTLBjH85gzg5gst95XyaXb5Q==@kvack.org X-Gm-Message-State: AOJu0YycH8F7aV0lUQmmp88+vd0CfCZkN2vljP4mOaP3IIzndBX2MsDL eac/UoStiyDjdJuiaawNjmcUhsPRZtvBNGL+sQONqHTRN772ht5Z X-Google-Smtp-Source: AGHT+IFlHjix7wS46i/6BDpKOsFLLemDZtu9UIE+/BGFSZx7YeAqH1r/3ADKC4uZTAVkOhIxOvQQLQ== X-Received: by 2002:a05:6402:51c7:b0:5c9:7e10:4fc5 with SMTP id 4fb4d7f45d1cf-5ca0ae874c7mr3116877a12.30.1729305456686; Fri, 18 Oct 2024 19:37:36 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ca0b0e6d1dsm1329498a12.60.2024.10.18.19.37.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2024 19:37:35 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v4 4/5] maple_tree: refine mas_store_root() on storing NULL Date: Sat, 19 Oct 2024 02:37:15 +0000 Message-Id: <20241019023716.4516-5-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241019023716.4516-1-richard.weiyang@gmail.com> References: <20241019023716.4516-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8BED71C0006 X-Stat-Signature: uddjwgexwhxtjysmqueapw1a17raqaqz X-HE-Tag: 1729305435-472251 X-HE-Meta: U2FsdGVkX1+agkcbGzv/nV76p3e/2CkSao0WdnOcskwdVm9AUMdvXCYGtrFUQ4CugV2TXknznfZD07sH5KGLPKMvLPzEanfFV7r/K00J3/hpVM1R02rIdHFneCJY4/xDw9tzCwN5EM7CEPtF78z0L/JF4wKUsCke8T5pD7G5Fr/B8Njy9qcukrQ7wD8783F2THZ2AuvoTJIRJ6aTvHDr5Wc70uOuu3Lq0busgOYLNqAQM8PgI5Tq9lwmKTOAs6+awviNbFXsK5EXzPdu/XwqhX5c4EN7Lcr1Z98jU3aylLdgC3tfs5Ll28kJGpMkJ2unNY1CxBLnsr1kbAxB+93PN2xqM6AP6ka6j1CaWn/dAlaimQvp0SB0VFhz0X+U4tWZa+qnH5BAkCiJAEeR6fDlTNvVtuAfBN2VS1YwTrdNZ8z2wOeKqDd+4tUVA5Enh/3Oi1QxbRyF3zfO7r0Igdf64dq2BYDVVh3D/KmaRP57Gyc0dH+rzaUVl/G5yr8Oc+lqbYYrMDDdWtrMDDsM/raDx3CYe+mZatYvoqfbG7YOOqRMfMnO2YlB79H2owwScomn4zYVnQ+SzF5msHl42K+V4Zpugh+5CorN8XlRt8fXPgSVpWSSlXZjPLXH/QNUe95hOJzq9oKgbRZLCX5e5YeXhSsCz44ZfDkMKUhEWso9qxmSQwea5Nq2ovxIia+Ed3uaYXuuNPtqfKhcyAnJPhjDVJncTGVgfONOGOwJ5Hxl9P4atIJpVyx2I7JGb1XWbiKAKnpHXwuPxsbvUbdqQc9AU0Uvvc1PTur0E4Z7EtGpebx+e7GqRCp67B96a7CgtBOjNtxy+Ad3dKNYSC8fftUyVLo/deETa8TW9l0vWx/dZX468jgQkyr9Dgq9VP9sShbQ1U1teaf+OFD9tpQwBUu7I5Xn2u2Kl7oFjusv1u9qQHMlXkEPbfHknU1n9Rrw/rt7JsXcdZtTK7F/syo8Z9s XXAT23zU 3e1z2NRXjfJWY83O8fZawd3fSU+frCCqbMZzcSrKtxBRjlylVhH8Hc+r/GEwyoZsZnu2YLZDfr1Rg6+9iF3jeq2zhsd2j+NIr+kR64CD/sASR1JFoJLahJdp2oMgQdWtSYMu+KLf/ccOmY9cKc3nsh6s2anTjg3Uol/Ej9FiTduVyyTC5jEsaeC8A4m/96oOUPPauwWCcFsmXARlgPt2DG3he72T40Y+NatE2nrHEnjp2mpdlXFPZJ2wTfjH78zm3F5Bpuys9swazjbVOaeRuZB1Mynih3oLRrKbOe1CbCv7mp/b4koTG2s7qxnhhnMxxTMKvqJvLuXIPswaR4JtTcE2GfCTbyqY+QlRp1KvnDOIWBzKZd0rOqfXzY9ea7OcbBpFYiD7nmX5l0WgAwUrzESmxUxC+2+X/3+H3mq9yEeNwJQxfM6FAYPTodVojQIJdMxopZI6s+pZmr+hvNWcMonF5hfHUNkn5FAqZYgRiUbyw1ek/JyCcgtKKnTjsOtbJcnv+ 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: Currently, when storing NULL on mas_store_root(), the behavior could be improved. For example possible cases are: * store NULL at any range result a new node * store NULL at range [m, n] where m > 0 to a single entry tree result a new node with range [m, n] set to NULL * store NULL at range [m, n] where m > 0 to an empty tree result consecutive NULL slot * it allows for multiple NULL entries by expanding root to store NULLs to an empty tree This patch tries to improve in: * memory efficient by setting to empty tree instead of using a node * remove the possibility of consecutive NULL slot which will prohibit extended null in later operation Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- v3: move change into mas_store_root() v4: add a comment and simplify the logic a little adjust the change log a little --- lib/maple_tree.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2226e77c00cb..1205a5208cfe 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3439,9 +3439,20 @@ static inline void mas_root_expand(struct ma_state *mas, void *entry) return; } +/* + * mas_store_root() - Storing value into root. + * @mas: The maple state + * @entry: The entry to store. + * + * There is no root node now and we are storing a value into the root - this + * function either assigns the pointer or expands into a node. + */ static inline void mas_store_root(struct ma_state *mas, void *entry) { - if (likely((mas->last != 0) || (mas->index != 0))) + if (!entry) { + if (!mas->index) + rcu_assign_pointer(mas->tree->ma_root, NULL); + } else if (likely((mas->last != 0) || (mas->index != 0))) mas_root_expand(mas, entry); else if (((unsigned long) (entry) & 3) == 2) mas_root_expand(mas, entry); From patchwork Sat Oct 19 02:37:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842544 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 625B8D3E1A8 for ; Sat, 19 Oct 2024 02:37:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA82C6B00A5; Fri, 18 Oct 2024 22:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C31CC6B00A6; Fri, 18 Oct 2024 22:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A34686B00A7; Fri, 18 Oct 2024 22:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7C2166B00A5 for ; Fri, 18 Oct 2024 22:37:42 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B5C38120523 for ; Sat, 19 Oct 2024 02:37:30 +0000 (UTC) X-FDA: 82688790618.13.4574B22 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf19.hostedemail.com (Postfix) with ESMTP id C64071A0003 for ; Sat, 19 Oct 2024 02:37:25 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=dNbs1Utk; spf=pass (imf19.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729305386; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=OB4aw/MWjvXDmbK8D7r6VWSH+ZtnOwNKP21OPvmuvq4=; b=ij///pLm++5T5nUb7YBgFMSaSJgWvaZ/9GyrSRxF50yzawklePzyr2Kmk098t+p9RKP+L/ 3C+/KjY2pBeEMu4IDdGWb3AlCvQwCcvAdjyH1qcnMHwzyaXAvYh7W+YwaL2D1Sb0JNW7E6 9csYbcRsPZyiT8BMVWmeq1KpDljHlcs= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=dNbs1Utk; spf=pass (imf19.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729305386; a=rsa-sha256; cv=none; b=2B9LxhYopWjN8wk5eQdiFKGNhflKB3XWOoBlWvuHCt0WmC1G1TEXNdqmlW4AA9senWpswm DEvwtXsqOBhtsLhs/4gXveCFotNWO0Hg7p12BQ7Fu4T638AS8RAmH4EZS3VuKpQc42E+Ng uJTeMcT7e7j3A+lnGbk681D7cYdbMIA= Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a99f646ff1bso327957966b.2 for ; Fri, 18 Oct 2024 19:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729305459; x=1729910259; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=OB4aw/MWjvXDmbK8D7r6VWSH+ZtnOwNKP21OPvmuvq4=; b=dNbs1Utkg+dootsgO/7nFvLOGh4D5fDKbGPPBF3kPZhA27Dh1AwYVy/z0qDL3s9ygu kXAeYPu7/OiKZDKRIauyJtc1qJqczPA/E98ZLbKC2VsFYU2nfTTdKrCy1K5GfJrmNgMz 6+bk5vdJWjZ+gYX0AtkPRgBWs0IJA2zqkKSZFL+uJ5nv/pyE8fIhuME5UwDPf2BxBLOt qKCk7n1S0acyVzcdAWz/Xde7c6PiLSAYgUo1QeKNs8Hcp+hdmTXwvE+Oc7lg8mRxHm3p yjdz1490+rf9hDqS65KjiVuStyuYDbZBUpMRDHMNyAqbuOIrwyR+1GdWGkt6Gj54/N5Y wZDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729305459; x=1729910259; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OB4aw/MWjvXDmbK8D7r6VWSH+ZtnOwNKP21OPvmuvq4=; b=AMntgDGjV+kxCamNBZPf5fJzezb6FT+BTnGgiIkDMl7sYOyTXCVpQtKPR7rBt6Ufk9 LtdpFgeM05p9abkOqilDsb9qrg9tY6sj29/Dzmaev9GnVSWevLaIKwW6TnHT47ZDyhvV dn9+exvCl+PFFBW5RRU9YTFy4y8Yjb51cM573xqXmpoqT/K+/3lwQtlxP+5umEIlB3+t e4cvdb4bQLa5K2CwgbjEFtQmQswjk6TLZGPei2fWkrpCub9vsyurHfcZqVUp/QTeA4GL C7ca44nDCek/ApZiodMyLkT3BVlOckYeyhPFphNCYiZUIFfYyTgoGuuRVMr1SZ4Q23kz gIlA== X-Forwarded-Encrypted: i=1; AJvYcCXAlsrACMqq7hoa49QnX2wcMXEnlmRDwTTp19klJAQBsCocEY2uxcIZRSRFnHmh3H3AplJocKz5ew==@kvack.org X-Gm-Message-State: AOJu0Yz/D9snKwoQxEwchVA8TecnTXgH2lEU9yRLZqUXW4/vKf4f6kf4 kNSUuMOfM37UNzQ8YtvwRyna2Q0XfKXwmG25omKmzWlnWNlALtno X-Google-Smtp-Source: AGHT+IFUqAxMKu4KAhewhvBI0mdz0eqghs/kee0UYmXbNthOUIgi7hy0sT/wo724scKykqr20h+a9g== X-Received: by 2002:a17:907:3f25:b0:a8a:6c5d:63b2 with SMTP id a640c23a62f3a-a9a69a7862bmr325575366b.18.1729305458817; Fri, 18 Oct 2024 19:37:38 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a92186sm159941866b.7.2024.10.18.19.37.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2024 19:37:38 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v4 5/5] maple_tree: add a test checking storing null Date: Sat, 19 Oct 2024 02:37:16 +0000 Message-Id: <20241019023716.4516-6-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241019023716.4516-1-richard.weiyang@gmail.com> References: <20241019023716.4516-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: C64071A0003 X-Stat-Signature: 56gnc1a9wusiz17pk3cembtnhj4ptwxi X-HE-Tag: 1729305445-854303 X-HE-Meta: U2FsdGVkX1+juCfOi/y3VpHnaAkYoj/YntnthG2sbDMJyXPgTcs65USubv2Z21OAa8wdKC5rt/15Zspxj+yc/esW5GdYBw1R+Di3UxdsTx/e8oaWNX3r83ZHRn/add68/ea2AcByEB3VrwpmuZory4eaR+fQV8QXmYUMqlGAyG1n7MkDf1gUtbmKSUfvPhMJ5JDagTbwMlAfjoESjXB2B9oU1GMbhnR2zctKPkPulFFxmRDEXsA0JzyvNR/yK1dHFU68HM0Av+MgrmNqN1RufZ1bNutHBNFytcIQseZdXiC4NMWq623wXulc1zY3Ureo/LWKKSbzHPKOEVBwpvflzJa3flmFBqIqjPjbjLc28PeZF6jhKIGQMq2NxruE5HQkdE5ryXMK9jU3IxzRC0yu1iZFYgUhpgC3o3GG2kTYqjtY8aLikowfPdbDj+8m1v+XTmnraRR+823Thrai0lJ6bd6rJMb+0bV7tOfGerFjKrKw61KQTsiIARUGayFvcD+qszZfEtv/C52EfMazZyxeDioaJp/68z7AFZuL6vrnU1JavXvNK/dEvGC5Up+LTkbxej/fsJHUBORttUMHfXqAgCbUjhKfJVYp2jBbKVuJgK2lCM3+8iS6Rp7ZJMPVwn/jq/0k2SxNCXMazb2U/9aSlj3G1OUzSPQ4olRzEZA4ly0ZIdGDQPkxRSYsPlMM2NgEogvLb36R2liQ2JIvZsWbB61A2jLyZas8hIEfoks6SOt5v5Kpk3bvs9Xkxndv5lMwKQkKcZZmlxbAdgfdOjJ34jHF9cat3jGVtoXxn+v/aCh5eKRf3RPXaybcXPL9edi3TdLNg2Gpt4eOMaRYtOEFr/Imh2dxYMU0WxbFN7gliUqIDO9YrVC+9mrScrdeRGRzOtewe8WjLVCXjk3QFrKiFeqkKUKQN3xDpx17p90nCuG3mp97c+6qr0YLfHSqcvGjKtH5hCK+STG+WvyXF0e teKIbfAB fJeoXaq81qPrNtlgeJzGVA8I8CiSu+Onql+P3MbI7zVff9uzfw+QzK66xJFAHWIFOHAN8sfjhyTR0lE7LeT9BRpdMh3tcVDi/BkmsNDID3i/VEVsztdB5NHZe6L2DE5i0lzyIP87J46C1BBTTNCAfqMH3mrP2fYWdP1u4jr1XNpHmqEx1znbGHTwWiklioS216mDLeI8OnAVy/o4mSkL0+mRbwytE44NymOcLuoxp+G353SzqQB/rdzKzo23OgnkcGkX/ZuQGnwuGQ0bP/2Ab7iIVot9QrS7YWC1emVrtcX4plNCMvmyFbZpyU2WfO76gAtuN+7rH2LJL40zxvkVztr/7OrEyeb6MPt8iMh0M3DNrGPLCsucmss2J/StQj2I3S2fA4mZjfMY4Cne9cvgcHzoLrM92ZZjCjAj8656OrMzIzsoySni4tjI4H7TXTBkPgMhHaoIW2rgQGEvWNeQ5kQ86cTIu42HKcuLqZBgLmL49/pi/JXhX3jwTFD1uhmFXqnvN 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: Add a test to assert that, when storing null to am empty tree or a single entry tree it will not result into: * a root node with range [0, ULONG_MAX] set to NULL * a root node with consecutive slot set to NULL Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- v3: move test into lib/test_maple_tree.c --- lib/test_maple_tree.c | 90 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 31561e0e1a0d..2ef72f6c6d1b 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -1387,6 +1387,92 @@ static noinline void __init check_prev_entry(struct maple_tree *mt) mas_unlock(&mas); } +static noinline void __init check_store_null(struct maple_tree *mt) +{ + MA_STATE(mas, mt, 0, ULONG_MAX); + + /* + * Store NULL at range [0, ULONG_MAX] to an empty tree should result + * in an empty tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, !mtree_empty(mt)); + mas_unlock(&mas); + mtree_destroy(mt); + + /* + * Store NULL at any range to an empty tree should result in an empty + * tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_set_range(&mas, 3, 10); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, !mtree_empty(mt)); + mas_unlock(&mas); + mtree_destroy(mt); + + /* + * Store NULL at range [0, ULONG_MAX] to a single entry tree should + * result in an empty tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_set(&mas, 0); + mas_store_gfp(&mas, &mas, GFP_KERNEL); + mas_set_range(&mas, 0, ULONG_MAX); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, !mtree_empty(mt)); + mas_unlock(&mas); + mtree_destroy(mt); + + /* + * Store NULL at range [0, n] to a single entry tree should + * result in an empty tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_set(&mas, 0); + mas_store_gfp(&mas, &mas, GFP_KERNEL); + mas_set_range(&mas, 0, 5); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, !mtree_empty(mt)); + mas_unlock(&mas); + mtree_destroy(mt); + + /* + * Store NULL at range [m, n] where m > 0 to a single entry tree + * should still be a single entry tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_set(&mas, 0); + mas_store_gfp(&mas, &mas, GFP_KERNEL); + mas_set_range(&mas, 2, 5); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, mtree_empty(mt)); + MT_BUG_ON(mt, xa_is_node(mt->ma_root)); + mas_unlock(&mas); + mtree_destroy(mt); + + /* + * Store NULL at range [0, ULONG_MAX] to a tree with node should + * result in an empty tree + */ + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + mas_lock(&mas); + mas_set_range(&mas, 1, 3); + mas_store_gfp(&mas, &mas, GFP_KERNEL); + MT_BUG_ON(mt, !xa_is_node(mt->ma_root)); + mas_set_range(&mas, 0, ULONG_MAX); + mas_store_gfp(&mas, NULL, GFP_KERNEL); + MT_BUG_ON(mt, !mtree_empty(mt)); + mas_unlock(&mas); + mtree_destroy(mt); +} + static noinline void __init check_root_expand(struct maple_tree *mt) { MA_STATE(mas, mt, 0, 0); @@ -3710,6 +3796,10 @@ static int __init maple_tree_seed(void) goto skip; #endif + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); + check_store_null(&tree); + mtree_destroy(&tree); + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); check_root_expand(&tree); mtree_destroy(&tree);