From patchwork Fri Oct 18 02:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13841027 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 5BEF9D3C544 for ; Fri, 18 Oct 2024 02:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E33546B008C; Thu, 17 Oct 2024 22:40:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DE2E56B0092; Thu, 17 Oct 2024 22:40:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C84E66B0093; Thu, 17 Oct 2024 22:40:09 -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 A86B46B008C for ; Thu, 17 Oct 2024 22:40:09 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E342DA04CE for ; Fri, 18 Oct 2024 02:39:47 +0000 (UTC) X-FDA: 82685168328.11.DD3D32A Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by imf11.hostedemail.com (Postfix) with ESMTP id ED15F40005 for ; Fri, 18 Oct 2024 02:39:54 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="gl/fXwjN"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729219100; a=rsa-sha256; cv=none; b=K4xCvWrBszj+SoUS8Pl6D70cQrS3FQ2tIVxi72vmTaKRGroMuC/kJ0KkcUOsc3REBZiPXk WxZ/FtPxQu7Ww9ew9p6VHgcYZ0rq/j+e+bPQxgXvkFxXDonXxlF1ImVxy1dpyMNFH77xjp PFJe005zUiHzw8JN+ceonPi+I3yIUhQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="gl/fXwjN"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.221.44 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=1729219099; 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=LU1gqRwNZikfrOmbGkcP/YBmAvz5LWB64++tvV0tsmI=; b=T/F4oLz0dkcjE5wsKvYf6xCu17kIMq/7hcq5D8R0bRfeyCo7n+BkjWJiiPKx4Gt+Kr1CC0 MX5OqMao8D5IVgTCuA56FGUAbigh/YQirtlRqj6qcYi+DpnkJLYohY/OLPlTF7SBpEOxaI oWgMX4cyYpUeKPcVITvvbj7Xd7fQnbA= Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d6ff1cbe1so1214596f8f.3 for ; Thu, 17 Oct 2024 19:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729219206; x=1729824006; 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=LU1gqRwNZikfrOmbGkcP/YBmAvz5LWB64++tvV0tsmI=; b=gl/fXwjNQzB5zxS51k5PCrN2WPxfn5E0hVhTXYeumjnHdaOXj1gPFGweRX51PM0t0p B1agITiETGOZDOc2vVthLokPyPhu+rPMN3FmozGsNuNUyC/lJWNpwRc/opUJydetFipB 9oEv1uBk0eMB3NFQLP6RpgWu6ME8UVJRhupX3qqusFTkvwKWWGapjp8WNJ/g1jVe6M5U a8FQgg8pABVz4iHKMiqQbw0GnoBrJ4yEOpJbht3c/Abq8WoVtw7VE8H9vuvnTqdr1lld Ehw/JLTQCiSUBY2PxPlK+/Isv3gtqaNmhFWnSJaKrTlVMReAeDFnY5iKBmo6bQJW5bHu nagQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729219206; x=1729824006; 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=LU1gqRwNZikfrOmbGkcP/YBmAvz5LWB64++tvV0tsmI=; b=heQ1GibfvjHMwm2pEpk67Qx7/OAGKIkIHbXQWbKUE7tKiRoxHPBklPhLdkTga3CDkQ uXzdeSm8hVljgEh4fJ0G19/n35/UufNGVVZeDniXUd3vmvBhVI4A4JfyJt9ND1ewiR7z 90V2GWy15aStzYLUpNyXzaBMIUjXXk8O3XDUfPBAt09sW8Nqu6mVIOnLrKIR2dG0k5Rl nKyxFnsYYuY5/PR9wUZPZo1bRuPvGjF1uLf/p6mP5/7P6FF3a01cuHfX92OjZ/8F0xsw xTVi26Wroi15XXT25nGd5b8Lsz0axynAU3xevIl6maXSun0u+HWG3rZSOBDsCgFgII9z i5qQ== X-Forwarded-Encrypted: i=1; AJvYcCXvNp6lBnYKUiyxJ3AdapqDssh6YsF9LI4YpyuF55yqfsQQ71+QXae6XF7tS+i5l3otWw0gAZFsMQ==@kvack.org X-Gm-Message-State: AOJu0Yz6/Q2z5Bwl2ohIzhPnVuHEMT8jFpcXAiRvtSql7fKgBsp4dzc+ yDGJL3kNQLKTS73HSo0NV7NNFE7ECZEHPw4szjvkBqczFyu9R8Lz X-Google-Smtp-Source: AGHT+IER7y0CuyKDEOqRyZ5dsEC5nQRNAAWEbzKmXhnMEIVoiM4m4kmnMsjCExAcuqF2TDBmyNk0Xg== X-Received: by 2002:a5d:660e:0:b0:37d:5296:4b2a with SMTP id ffacd0b85a97d-37eb48bc5b8mr445360f8f.58.1729219205778; Thu, 17 Oct 2024 19:40:05 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ca0b080906sm173477a12.29.2024.10.17.19.40.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2024 19:40:03 -0700 (PDT) From: Wei Yang To: Liam.Howlett@oracle.com, akpm@linux-foundation.org Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v3 3/5] maple_tree: not necessary to check index/last again Date: Fri, 18 Oct 2024 02:39:41 +0000 Message-Id: <20241018023943.13860-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241018023943.13860-1-richard.weiyang@gmail.com> References: <20241018023943.13860-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: ED15F40005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: xbuo39hyy541u48fqcgpf35csdn44maf X-HE-Tag: 1729219194-236288 X-HE-Meta: U2FsdGVkX19JA02dOd6SRFcOk0RMcOYMhw7iiGmXdP484lILKbbwYgOdGm4zf+TPytoazhH9ReuuZpSrW2qmfTrha3JScmDkMRpxSjjxKT54jfMaoikrrQPTO5ed6tHfBX1oM7FCZ/i6vVBhY/nyIqvlBPv85ckRraJP6ta7AahTBLEIG2MujJqdMEIro8gEU5X3vxDbVNDqLfwxWFwT9arXTc/m9U98usSxh9em4s9EJu8Qx+r/EfZIamEwbvuXBH7IHSeRCahMt9dEQFGGmSiS9HOn9a7pc/JQ8iq26rjut0flCEXcM6O2o5rUVSILGSxg67I/974sRYNZG5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/2mdO7cFFDHUDKIgO+0cAjvX5UsM2IaNeNWlq7Iu2JPszJLh2KfNThl/fybXwuiKyvBFN 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 --- 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 cbbaaf60efa9..db8b89487c98 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3662,7 +3662,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);