From patchwork Fri Jan 27 19:40:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13119248 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 3BC59C61DA7 for ; Fri, 27 Jan 2023 19:41:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01CC86B0081; Fri, 27 Jan 2023 14:41:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DD5666B0082; Fri, 27 Jan 2023 14:41:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD9676B0083; Fri, 27 Jan 2023 14:41:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 971E66B0081 for ; Fri, 27 Jan 2023 14:41:36 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 744B2161039 for ; Fri, 27 Jan 2023 19:41:36 +0000 (UTC) X-FDA: 80401598592.18.A6E88CF Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf08.hostedemail.com (Postfix) with ESMTP id A9D6A16000E for ; Fri, 27 Jan 2023 19:41:33 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=rnpUdmPc; spf=pass (imf08.hostedemail.com: domain of 34yjUYwYKCKocebOXLQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=34yjUYwYKCKocebOXLQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674848493; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DF9zqRO1prEDm4IKfYXh+Z69pFj8RdYSRvmvJpFQZKM=; b=s3G3Q/0W5PLcbidORPXwij5JJ/jE3C3p/xcKaBiBry84NejWTGob5OlHwJPilR69ZjemSo vS0gkdsh4ub8qNLZxsZfFNOZyWTEoBeCY4qiHyL4KgZxOh5vLWN+P4zXlHjaUj/iCpKaek 5AkuR4QjL2CmkBr4s2vPvb24q58M8Mo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=rnpUdmPc; spf=pass (imf08.hostedemail.com: domain of 34yjUYwYKCKocebOXLQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=34yjUYwYKCKocebOXLQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674848493; a=rsa-sha256; cv=none; b=iJTZL5utHZzshUNogaUu1DhMHEqAy36YdYzgADX7Rwpq496fgS0qD+UaAEI/FF+eqrbaeB Ve9EXoDAo8vv6ni73qLAGbK68Su5FoQcrT5HWWVz846LBbH6a8Xig2D4hyuOrCsB+9pOoI rko3v2+usGxHoM8Rn41htm47mj/CifU= Received: by mail-yb1-f201.google.com with SMTP id k15-20020a5b0a0f000000b007eba3f8e3baso6326351ybq.4 for ; Fri, 27 Jan 2023 11:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DF9zqRO1prEDm4IKfYXh+Z69pFj8RdYSRvmvJpFQZKM=; b=rnpUdmPcBnY7plbcdmS2pwvwnctQIRIqHumfjs2guCuPsY+Dw6YQ2tfutal8HnrgXz edy5Yrgey9QhoRSbyw/SmRVhoDEfIcnSP0t0LCmLUom2gJSxBSb6RoRoQ6R6E1A4+8T0 XcTb3Fhtcz5YcundAJZb+WYoiQCLWWkiPl+/L7XZyu1tWh8b/ENfJXXDc0COCB4H0HVg yuAJnUBiF1z/T9ta5KOn1AHf3cQZUH/oUuoUg6oOo5mcl+MifhrO/XwhHeojlZjv/4Mm lccC2wtCBVxTksQLP5lorO6u35MCkxakWEmMvAgnG98JEeGI6fsdBcznmI1LtXlDE24U yV4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DF9zqRO1prEDm4IKfYXh+Z69pFj8RdYSRvmvJpFQZKM=; b=u1RvYtlLuOKaqX6mfqnSOb+bqk6w7Dhovuo9oQfe9m2wkL3v/Yq7CiQk1u5uY4NGxP QBgH9MaIYz3asBkFfZCPY0AwIhFANCQUAbtguQEFsB5pwbpVWlG2Lp/cm8HGLv4zav/Y /xgyCAlB4dtaJHrMgHv22EXAsK6eVNVCW+JjCUdqSRK5QYfX54Ji0uG423iJjn3OEFCb SeZuegCDxxmPu6Uf3qfM3sK0n0lByls5eigbWPRPrB6yG4yTva55c6Y0TWSh1g8kji9L F0msnKKWabt2PZtGjjykex+UvoEHnabtYXoFfaJ5VkxItHEcMHnMQ+MW7x7lYcDtuEZT wa1g== X-Gm-Message-State: AFqh2kp63OGQ0Q5sn2UcOuR3d5ATCAjASUwTmC6XCc1zcdPkhTVVCcca mbYoTizyWx+7t4C3lGN/41Tt4kVZr3U= X-Google-Smtp-Source: AMrXdXs3xZaVcR3p65iqnfy8qe0w+PmLMIhbeI9n6IEvkAzMLp6jSQOzi5T/oBy2kRvdJXFWY9xcFs4GkSg= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:4e19:be9:c5d0:8483]) (user=surenb job=sendgmr) by 2002:a0d:c8c5:0:b0:4f3:10b1:1351 with SMTP id k188-20020a0dc8c5000000b004f310b11351mr5009568ywd.516.1674848483749; Fri, 27 Jan 2023 11:41:23 -0800 (PST) Date: Fri, 27 Jan 2023 11:40:41 -0800 In-Reply-To: <20230127194110.533103-1-surenb@google.com> Mime-Version: 1.0 References: <20230127194110.533103-1-surenb@google.com> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog Message-ID: <20230127194110.533103-5-surenb@google.com> Subject: [PATCH v2 04/33] maple_tree: remove extra smp_wmb() from mas_dead_leaves() From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com, Liam Howlett X-Rspam-User: X-Rspamd-Server: rsp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Y lhIOg7eIqmmgaawguShfsBaKGkjCp7HO8s3iL2pZsTEJ/k7FN2HydTAG0gazahSpL8nGDFtg/jRLi4lP9yCaqHSHCDMJt4x4EbOQ0p6zAEtTb4AyP5QgLCWwQU2tXRjER48nqnYg1l5VhqcBxDmUxo9G06CEma2atsKjwL+kl8pJUMr4gbYqBOvgsiJiRvnD+BIO026Ls23Uv8vW5Y8KpcvYVdJdpXOBS9xiXQBP+VcH/4nhDq+HC99f+tEK4RE6e3SWIp8c932+O7MPALy0AgKmcUFyKOLB/eX7W74tANrQP7F3F5MoF2wAev1L6DihRTMYyU1Dj5TZLPRcDN5FO9PqdUyxxlaYsz1f+sjpg3xMDYHmLHIbww2yhR9w7qa1Oa6Tx+G9aDIb+HC8DaCpXBnqW187yZ6R1eQTE9I6MuHBM54MKnmQQhnsdzNBsjU/61O5qrVGlG415Gi+Qrkl+21nqwzr+2qF2GDrf7XIMp7mtzoONVW5IAcm1/ScY6ZLCkIviCBOc7Y8H0I0jeSdhR+8slEu7Rb6k13lvAcwXhac3wF2PVJU3Q1Kri91+iU43R72XGbWkj7ZKbm/+nqAc8BHVni5faKuGmLDBbYkuUWSUbXpX32xLAXPEanXH2HDpqNzKIg4XYTSJpldD0wL5LvZHoVuf7aFUvHgG5ZYXzMeK1KP+fO2B0LmIKNq+xlYeWFCZ 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: From: Liam Howlett The call to mte_set_dead_node() before the smp_wmb() already calls smp_wmb() so this is not needed. This is an optimization for the RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett Signed-off-by: Suren Baghdasaryan --- lib/maple_tree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 73917dd2c608..75cce2d4d5da 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5510,7 +5510,6 @@ unsigned char mas_dead_leaves(struct ma_state *mas, void __rcu **slots, break; mte_set_node_dead(entry); - smp_wmb(); /* Needed for RCU */ node->type = type; rcu_assign_pointer(slots[offset], node); }