Message ID | 20240919234832.24237-5-richard.weiyang@gmail.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 060E4CF397B for <linux-mm@archiver.kernel.org>; Fri, 20 Sep 2024 00:40:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8621C6B008C; Thu, 19 Sep 2024 20:40:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EA926B0093; Thu, 19 Sep 2024 20:40:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F0DD6B0095; Thu, 19 Sep 2024 20:40:17 -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 34B7B6B008C for <linux-mm@kvack.org>; Thu, 19 Sep 2024 20:40:17 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id ABE5DAB7E6 for <linux-mm@kvack.org>; Fri, 20 Sep 2024 00:40:16 +0000 (UTC) X-FDA: 82583260032.16.A0F338E Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf24.hostedemail.com (Postfix) with ESMTP id E284618000A for <linux-mm@kvack.org>; Fri, 20 Sep 2024 00:40:14 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Vb/O1XRK"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.51 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=1726792689; 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=IooE48wMynEcoclDwBLR56J5Lm7xR6JbzWdlx2vrATs=; b=Se7kvM/Cn1ciAD9I1K7qAeuDFFC+g93YwgovAt+DSlxwRBHh05oXBKLfzpd52dwNZDslcN aQyaQiYOLjZN1C8Q8qRL/Ehgi3AzKnXoV0ZfhFT9uOJvrNFHzAoU97BiyetD84WOs/Wo7m /Q0IJsF8vn2MKtzr963QgBg+QxxhYJw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726792689; a=rsa-sha256; cv=none; b=RjHF5Gf5eL27ia1ykJQy38/lxvB5BNB6I3FfZN7MurjcZi/UtysBKAoBdtK8O055tmWzy3 XURvsILUy+AgUsKYft5SXwSdxvF5RZOfnIweSvdyGipO4DMCMLEkWMHpUg9+/MqTiB64fA Vh5N4eBufzfsLXaHUGKYSsrceNBeYqU= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Vb/O1XRK"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5c42bcf35fbso1931783a12.1 for <linux-mm@kvack.org>; Thu, 19 Sep 2024 17:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726792813; x=1727397613; 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=IooE48wMynEcoclDwBLR56J5Lm7xR6JbzWdlx2vrATs=; b=Vb/O1XRKBuuhVHRPfzZv/k3oOF6sVzwm7k92yxjrnQJjPHUXdT2/y9aemH6/xx9w6V XyROZKbcMfJ4nbUSuhKyE0BkV3qE6hjWI+92NVHAElrweIBWnokovxO9/ekXkdswgFGX OhJGOawXawsUAqPahP44tfQfep/SPxIKZQiFAvA5N5DiyKLyN67hrGbHkYvj3QCAHNOb eRgvwWCb9gyjWZE3Ujb5U08L/g5msK/9qy59dlZZp39MKwDsv0OKxHcfxpcv3GPP6N3Q fErde/7R8u47uTujCpS57G+wjcFJ3qw5HcLSIynLvA/ZhwRIYnXgmmICafXa5df7g0pZ ZAZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726792813; x=1727397613; 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=IooE48wMynEcoclDwBLR56J5Lm7xR6JbzWdlx2vrATs=; b=Df8hBB8o7VX3Bji4Hi+gO7L2Az5sjokmE0EzQKZRxPJAZbVDphJ1cyyJbHKRovSJ46 kgCV5F7d2s3l+7+DqaimVeM6CL+hQfzmZR8VJHO4yqZyJ1msVpxpI3AM9YKZACSwg3oP YRctY++2Ap/XubADPU5RvFKwxzBwnRyPTbp/jbc8asSZcWKG/YaD1gym33EuspFy8Zc+ IPRKjSpZ7ozXbntgK6UNJcEsJ0QW7xrLBzGgS2Zv5oy2f40QrmR2UyCVVyuS4ccmUMa9 KviBFVJdrjv7W4Bp1PsS85fleQzQSskMIwQ/eUW0FdKarZCmQ149k6w75k8cnNNUZH+b DSOg== X-Forwarded-Encrypted: i=1; AJvYcCVpLuBGv3njzcadrdbe65S+ig9IV1z2vh+ydgEwgrsjdavhCxRKPSzb22FSbtkBt+QlbBh/bkeJeA==@kvack.org X-Gm-Message-State: AOJu0Yydo0tbHB5zI4Txu3G38V2fSiaqnAx5HqXzD8L1Kt3XUyECs+Aj Ll7/FXGRx/uRyiptaMpnXXJ/oyQ/lO0HngqAF4y4z6WByeXgvWx0 X-Google-Smtp-Source: AGHT+IFRBsLAhgNlFvg5x+oK3AK4SEjLB3PJ5jaJKsbqQfOnTd9nmvgjt4KuocdHu6PNL2fACdHr5g== X-Received: by 2002:a17:906:6a11:b0:a7a:a212:be4e with SMTP id a640c23a62f3a-a90d4fbc673mr93599166b.7.1726792813288; Thu, 19 Sep 2024 17:40:13 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612e67f3sm772752566b.185.2024.09.19.17.40.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Sep 2024 17:40:11 -0700 (PDT) From: Wei Yang <richard.weiyang@gmail.com> To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com> Subject: [PATCH 4/4] maple_tree: now we are sure mas_end wouldn't exceed mt_pivots[mt] Date: Thu, 19 Sep 2024 23:48:32 +0000 Message-Id: <20240919234832.24237-5-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240919234832.24237-1-richard.weiyang@gmail.com> References: <20240919234832.24237-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E284618000A X-Stat-Signature: 5pgcc86hu6bs3fmp7uncsopgkeu5j44u X-Rspam-User: X-HE-Tag: 1726792814-314696 X-HE-Meta: U2FsdGVkX1+KzxcNch5wcTDrFeyrRIbNXAh/OlgIy4x3QLWTcYBaRwne4AjNS/nX1x2QiqqjzW6KMgNOt3FQcqAlJympS6N2GeJnT3nXQXdJjJcUiPwfNOOd9uyoI+0izdRHp3OeDGd2r37MfkVyBabFUWioIj39ru4c6QrM8OQF/PYKFG9eAT/H71L3qEcgaR6zd1Z+LYtLyqG34cZwOwMKCEBvqm9XWuNYtRbu0zWIPoaD77AtGA0uDP+HkfCxcmGxI611Ie7GjpFuD6A1Fkh3ERsNFvDDCQwnFl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hcK+X5NXRgiAU+LN2aLcGCokrCwEAzKWdj8lK3wnaTo380jU5quS9Uh4nU1HAl95fRdUv9Nb2Uyq64fp3P0y09Scst1DMyyf7ZHR9y0PwPyaU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.017338, 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 |
refine mas_end of mas_mab_cp()
|
expand
|
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bb4183b973d4..ef9aba07adbd 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1907,11 +1907,11 @@ static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start, void __rcu **slots; unsigned long *pivots, *gaps; int i = mas_start, j = mab_start; - unsigned char piv_end; node = mas_mn(mas); mt = mte_node_type(mas->node); pivots = ma_pivots(node, mt); + if (!i) { b_node->pivot[j] = pivots[i++]; if (unlikely(i > mas_end)) @@ -1919,8 +1919,7 @@ static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start, j++; } - piv_end = min(mas_end, mt_pivots[mt]); - for (; i < piv_end; i++, j++) { + for (; i < mas_end; i++, j++) { b_node->pivot[j] = pivots[i]; if (unlikely(!b_node->pivot[j])) goto complete;
Now all the cases of mas_mab_cp() is called with mas_end at most equals mt_pivots[mt]. So we can get piv_end == mas_end. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> --- lib/maple_tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)