From patchwork Thu Oct 17 13:46:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13840068 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 5161FD37491 for ; Thu, 17 Oct 2024 13:46:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9A0B6B0089; Thu, 17 Oct 2024 09:46:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAE116B0092; Thu, 17 Oct 2024 09:46:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBC1A6B0089; Thu, 17 Oct 2024 09:46:32 -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 98D1E6B0089 for ; Thu, 17 Oct 2024 09:46:32 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 8378D1C723F for ; Thu, 17 Oct 2024 13:46:19 +0000 (UTC) X-FDA: 82683218604.27.E0E70B9 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf12.hostedemail.com (Postfix) with ESMTP id 56B8440012 for ; Thu, 17 Oct 2024 13:46:25 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=F9z223jW; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.46 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=1729172742; 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=UJ+bQOr9/QM0H0RV0ApGOWUZvav2eGO4ARNqrpdi1d0=; b=3libsgUWQrLOERcD7P8Bljj0lk8m8ZUqZrGbDikR45kRXllA5r/mAVeBrDC6ZuoCvpdDqZ IWOyTg+lyc2lj1Iy4SMjt8GvYvfcpkvoZpEL/kjhssd4e2+AfxBCB5VZF+ylBbbb7cetf9 1oLOxPsFJVRYjJe9lrpuuRjp1FTQbhg= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=F9z223jW; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.46 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=1729172742; a=rsa-sha256; cv=none; b=IcHn7YWd3jXi/EmbwRLOsMH1RJgDF2q2/VVLB71doDHpAJDzlMw+bXegppcaB998mVBk0j 8nf5ZIK1Y7CA/mV5y/PHLxpWCF7WPeeGLoEwIXAHrPxZ/zlV8d6A7Pvx9XJhUVevZicXvg P0Av7i8Zn8a3e0pUWc1pgO1e5E5JcA4= Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so126956266b.0 for ; Thu, 17 Oct 2024 06:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729172788; x=1729777588; 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=UJ+bQOr9/QM0H0RV0ApGOWUZvav2eGO4ARNqrpdi1d0=; b=F9z223jWC6uDY7N0Wvk/4BYTO3OLkVJSIqZe3kXcLcfpWhKDUD5I1/67CB1VqLPlh6 4yw+roZYhU7MUHOV18tnhnzSIUKwGLB4NQJIi9c46hbiQTFTYur79Ujvu6WejhfcAN6G Z6KiH4XWWkwueo64EqpETboJV7uWBqtko3saJqDzrlcTxqJAkXorUGizIvGwsYmGpMo3 8+8t1rz+PlLnapbpEqNwlCLRHjrwp0pNF4vDRRiKTvCffnckdKJBk6ZP43xjuHHx31YO GC4JuYGd2Mr1aX5v+C9b8WzGpFNqOOu8buZ9dC1ycrn8lHKaNZvExVO2wqisfOzZu0H4 uIrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729172788; x=1729777588; 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=UJ+bQOr9/QM0H0RV0ApGOWUZvav2eGO4ARNqrpdi1d0=; b=ru9iF7FlibVT28OX4RwsrKa3vwqpAAA7bHEdRS1GpLUnaVvD2MeSbOw3uttLsLeKIM oEnAj+YO4RoBJDzBXipF3pNBPmYbNIp5UY7Fto+isfixygsZ+aExoJ1eUNu6KtxlHBaU D0xG5pLdH7PvTyFDHuAz6aq6m7OyZ2Z0pB/RmLn+8Cwh+E6NySJf3L4SNxi5A9sJlW4D zwPQAMgv+uAD/bRBgTf5u1GAhiS69RuEyo54rM5/uTRUSE8Ftvt+RRwhHA9tUzLIV1+x oQoFCyTkfIJy9WU32yqF/SQF6ZuXk/A4vQ8J5oizjhQPPRoE0kmVwde0FLKDvBo+rU84 2+EA== X-Forwarded-Encrypted: i=1; AJvYcCV6nEqcmEsINmuCk0opAD43uK7sSKGTGF/H4iUkODkv9g++3XHABLsMT2h5MaRCyoZB2p6VaZb/cw==@kvack.org X-Gm-Message-State: AOJu0Yy8h0085HpKxX/rzJiUxvNBX5xJDI4kjrdKsjfLMih8uoLw543F xhx+S0G0gvMzt1dFmYunzjXc2rXCx9R0zqnt40rQhkV+UA36qFRcXaZfsTOS X-Google-Smtp-Source: AGHT+IGw8HkQAhg4F160G1+4xn7VcrsuB/0JlG92c9b4F7StirUCFDBFkdLld9oSrjt1hdmUwtceMA== X-Received: by 2002:a17:907:3e1b:b0:a99:ce2f:b0ff with SMTP id a640c23a62f3a-a99ce2fb227mr1873098866b.33.1729172788248; Thu, 17 Oct 2024 06:46:28 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a298443b9sm300399866b.170.2024.10.17.06.46.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2024 06:46:27 -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 v2 3/5] maple_tree: not necessary to check index/last again Date: Thu, 17 Oct 2024 13:46:05 +0000 Message-Id: <20241017134607.30206-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241017134607.30206-1-richard.weiyang@gmail.com> References: <20241017134607.30206-1-richard.weiyang@gmail.com> X-Rspam-User: X-Stat-Signature: pkq1bhw69smnyk3tbshss3wyx1aa138g X-Rspamd-Queue-Id: 56B8440012 X-Rspamd-Server: rspam11 X-HE-Tag: 1729172785-917129 X-HE-Meta: U2FsdGVkX1/JKQ+5jovyPfxlZLjWNslqv9v9TLEQA2c3o3ISLkAoJiwyJ+tN4E95h0+OhNf9ISzA+p88OlwI5pulaPa4MvYuNrOQM4mbJBOo400MO3Pg1lVYezbw0nCQa5Q4X8TToEnuASV0DHjO0PLVxYRMjqHwHn2jsMXDFQoVQm66lXq99UsTSw3bjZzfkQS7w1+onYlOoen+A5wO97S+FklNPqcLBLTIbASaAfHkfH1EHs0DTvNzy9EcEoLDbwbRwK4kgZziK7D2fiC4o6jiwHOLaD8nh8HajgBRN0sjVhTNc5PS2Iw9fT1L2bNH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ChaPsMyT0wj+n6CUu1PC5k+Y9nt+jatEF3iwbXN9SzaahFHOE6h9R41MRARwjZ7/t3PI3spTgDNhyLNokFk3LhnJCxxTy X-Bogosity: Ham, tests=bogofilter, spamicity=0.000146, 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 --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ff9d972dba4d..a90c29156fe2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3591,7 +3591,7 @@ 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) { + if (!entry) { mas->depth = 0; mas_set_height(mas); rcu_assign_pointer(mas->tree->ma_root, entry);