From patchwork Wed Oct 16 00:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13837477 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 67BBCD20687 for ; Wed, 16 Oct 2024 00:22:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB62C6B0089; Tue, 15 Oct 2024 20:22:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3DA26B008A; Tue, 15 Oct 2024 20:22:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C900D6B008C; Tue, 15 Oct 2024 20:22:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AAD8D6B0089 for ; Tue, 15 Oct 2024 20:22:50 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6E8A741A2B for ; Wed, 16 Oct 2024 00:22:44 +0000 (UTC) X-FDA: 82677564564.13.41D61C0 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf06.hostedemail.com (Postfix) with ESMTP id 8584118000F for ; Wed, 16 Oct 2024 00:22:42 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SpENEsNo; spf=pass (imf06.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=1729038095; 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=feFYTn2DwcxxK1/gGgrI/c+N37acDBpmDmc8y/yNEVs=; b=G2HzqOm8J1YwYMt4iR6x024DTek3c5oDZAXqrjpcw0DiacSmP28ic/Obl01SI1EB5dLHhr gAZp3Bzs6ljlW53KNf/fWcUExXUCl4jhswWfprvLtN+vy7iYxu7EOSgoLxWxe1JAJtbhzF XH2LLTFw7KkxFpnTQPg9sJK6J/82joY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SpENEsNo; spf=pass (imf06.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729038095; a=rsa-sha256; cv=none; b=n8Ldws3Mh85YBZUc9CxlK5AYAcvbhkuSmIPZH+dfy/WIP0e59PD4e50leiqwzRny5UrzBD gckmLjUYnGi3Sk0iylL5OgApoGPpv1C7v/GKO0kfmdsJHNPC1Fmljh5gCD476zMnX7OZDT QXkxLCrDTBFoapHTiszUolyfKWFtfeU= Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5c96b2a11e7so4407996a12.3 for ; Tue, 15 Oct 2024 17:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729038167; x=1729642967; 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=feFYTn2DwcxxK1/gGgrI/c+N37acDBpmDmc8y/yNEVs=; b=SpENEsNoPev2BjTDjMnNHY+kb+v3v2kMJvcju2dZYSTg2Z/7CdqCPf91bgabrUns7n jNu2JnufbJRZn6dy18xcq1A6wpqt4LFuIHZ7pqraoC4lHWNEYqQXNqDrM83/t6YmQqpI wa8Kw21uFbJMnF2ZNYMOxM44v0xZppJhCTfhNsQzk/39SxqGwkRY/SI0UnkL3HmMD1Ov 8aQDh7MDaKfYZXJ/Lo6DaFIgjCnjKiw67qDKGWAZy5yahb02cxrs3jLWK7a9z1BEYXRH Njw3KHEQodGIImN2ubtaUj48nJBNYGUe38hZrG7S0mWT8/LSVpv/Cwp91ZLMYZnl+5Eb u43w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729038167; x=1729642967; 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=feFYTn2DwcxxK1/gGgrI/c+N37acDBpmDmc8y/yNEVs=; b=C5bICMTXL1ovn/+Q7LFyKE1ARyHWMXK5yrmfUfRt2bXESG5z9ZkG3U0FarUhYG26/5 Eco5XcW7n/u7FvdfRNDAqKKx6wzJae1RvTYpeOCLhqKV6f/pAIRXqBu8e2SddMk47ILD f52nemAtak31GE4ZSB5Aydozau7BBiTLQyP0Tr4/fVSJpaoS7bTNReIetMFYhBGulMJm 2bHksGLV5bFfEu3NJvgOVpoF4KdbElTVWO4ewL99rNHUVBOd1s60qijlNHzXcrSFyg/i sy8f3YmH0wTkXQEHiio7Ja2CsdigeE+tY2q+/IThIZ1tWwnxbjY3bsldU8fxt4UEWUEb wifw== X-Forwarded-Encrypted: i=1; AJvYcCUCjmrO23dZYRnxgMh6hQvjrhGmuLnTAeIVhGF8dldm7UbyTEZWyrKQH12t4JnVWZp8PC9eoEKYHw==@kvack.org X-Gm-Message-State: AOJu0YyNdGny0OLGjQBhzncTwnrCkQpsHZATFOhjKeTREmlxnKlr+O3q D6fpI86yo4eKqaz++H9P3ViMqOKQ8atUqcoqQpxpaiLSIQFI+SZ4606mdnND X-Google-Smtp-Source: AGHT+IH9DW//5LVneE0dAj93xoI1yGfzxl0BUQUToyrbydzth2nBUkrHLW84Mco5ha3oRiMorl4yww== X-Received: by 2002:a17:907:3da3:b0:a99:5ad9:b672 with SMTP id a640c23a62f3a-a99e3b20bfcmr1416594066b.10.1729038166648; Tue, 15 Oct 2024 17:22:46 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29749559sm120184166b.58.2024.10.15.17.22.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 17:22:45 -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 2/2] maple_tree: remove sanity check from mas_wr_slot_store() Date: Wed, 16 Oct 2024 00:22:21 +0000 Message-Id: <20241016002221.32428-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241016002221.32428-1-richard.weiyang@gmail.com> References: <20241016002221.32428-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 8584118000F X-Stat-Signature: 3w1ksunmt3dqa7he3r6ram4img1gfq9q X-HE-Tag: 1729038162-712664 X-HE-Meta: U2FsdGVkX1/Kfq0zNUSUy0X6vlLxH9gHEA9GrhIUESQ7TXkOGVfjFGiWb6u81/b3pkedvZVrgGfmMEDvhc7ipvv7RlgkbuxDxhXyOWIWQOrzxsL8IMtXyzK5X3QS5cqhY8sARXmgo+aJFEm4WT+ual1HA0ynYr2YgykUorBykMvbQGhc6yAmTuQEiaUtb9VxwUJUF89ir7kNb0P13GANZVBad5/H8AY8y2jRYFXkzf6A9pyt66+z9rHlfJTphbhWY9TXLP+zH+RVP3J6XKutTqGkI/d4fajtj7qvnGdow/YaaCUKoLrwwmAvs/gfV8jJmxGUsdjRq7Pn/qfVPimPW2/L/5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Y4EAdEDF1ZM67ZBiiLmx3nV0uY6PLSgsv+Arbp8NMjj5qv2Qc2rhaO3+08f6ZvqsgK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000074, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: After commit 5d659bbb52a2 ("maple_tree: introduce mas_wr_store_type()"), the check here is redundant. Let's remove it. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Sidhartha Kumar --- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f2628e3f3efc..5dfc589a8cde 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3810,7 +3810,7 @@ static inline void mas_wr_slot_store(struct ma_wr_state *wr_mas) wr_mas->pivots[offset] = mas->index - 1; mas->offset++; /* Keep mas accurate. */ } - } else if (!mt_in_rcu(mas->tree)) { + } else { /* * Expand the range, only partially overwriting the previous and * next ranges @@ -3820,8 +3820,6 @@ static inline void mas_wr_slot_store(struct ma_wr_state *wr_mas) wr_mas->pivots[offset] = mas->index - 1; wr_mas->pivots[offset + 1] = mas->last; mas->offset++; /* Keep mas accurate. */ - } else { - return; } trace_ma_write(__func__, mas, 0, wr_mas->entry);