From patchwork Mon Jan 9 20:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13094270 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 11AE5C61DB3 for ; Mon, 9 Jan 2023 20:53:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A34558E0008; Mon, 9 Jan 2023 15:53:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E5108E0001; Mon, 9 Jan 2023 15:53:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8373F8E0008; Mon, 9 Jan 2023 15:53:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 748DF8E0001 for ; Mon, 9 Jan 2023 15:53:53 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 479A6A0BEE for ; Mon, 9 Jan 2023 20:53:53 +0000 (UTC) X-FDA: 80336462346.15.5900231 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf18.hostedemail.com (Postfix) with ESMTP id A74FC1C000C for ; Mon, 9 Jan 2023 20:53:51 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fcpOTy1E; spf=pass (imf18.hostedemail.com: domain of 33n68YwYKCPElnkXgUZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=33n68YwYKCPElnkXgUZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673297631; a=rsa-sha256; cv=none; b=SUr3XmJA1EkR8oSCMevxU9VNK/94GazSeOuiPokFLCQ7zo88FTh9x59KQwfHQ0khoNHgyo 1vzC3RqQZXu4wmaQTH4fUILMvG6nwPf9J8tPDnfkv/2RYEVs0PqGbr/DJJYh+QYEqYgQ/o lzWUNEvIPUYYpDkuQC/2SjUsNAhOdq0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fcpOTy1E; spf=pass (imf18.hostedemail.com: domain of 33n68YwYKCPElnkXgUZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=33n68YwYKCPElnkXgUZhhZeX.Vhfebgnq-ffdoTVd.hkZ@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=1673297631; 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=xyMpIuQX3h8xEF8sgRu6qp18jXndG+tVBpDaAHqFUcE=; b=PUemKTeQZ5NUyk6IUzhDp5uj16LuzCzURIZ0TRpg94hCP2rT8ru1ao4IsSCb5d80OYgjwR qWILspwtPZsch8WjaW9yh0I3q5hh1X6RiBQwOSMDYbXSwd/fUwOYM4QnHswMEiN9SF/e8x a6gfFNaSOqHQ3hIdIoYyuivUfgT/h8c= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-4c6bd2981d8so66527627b3.2 for ; Mon, 09 Jan 2023 12:53:51 -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=xyMpIuQX3h8xEF8sgRu6qp18jXndG+tVBpDaAHqFUcE=; b=fcpOTy1E+3ThlAgpg3hHomgF7jysjdpHFVliFHHbaTXw696G+d4UafDfpkipyR4nuU tlOJBreetd3v3dCXyb/Rdewxh5p1khH4cqHcd7IJy4L2zy/b/nqItrk1BUqrfoTrE/cO 7u4Zqnf/OqJvpx/Forf/3GSWw4rGhAxROXbd0Dn4cjHGhWxv2F6/FkGrRQlT4BSVn9QB Gq9sxTxT4dzmvld2wEbl8PkQKZUyemG56T9+2h4MZ3hLbr2uHjNUXIbifPrLJAMZf98P qyO5BkbAlxHe07UMVtRr4iqChj93uPwUR0TOsMr/XaxeajQHkPY5F6oCUcd/VOMyVzz5 1yLA== 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=xyMpIuQX3h8xEF8sgRu6qp18jXndG+tVBpDaAHqFUcE=; b=AsB2ysbA8hT86UPEh+kyfgBRgiIKW5HXpwkx/rqk+LONYMdWYhlIWij2l184Up5ZdP hRxzn6ZAw3X1qcf2/AfW9hcU17vohe9n8kACN5n1PI8d8QUX8W6Kf9aVxuxTnYKpxJSO vWpXgr9tyXdy8tMfbtco5Ig+scMl3QfD0yPxf9bVgNyZ6W0wkbgDuxJ8lpncb1gDEkUZ lBifqdN4NCd2slfAU98MfFsgqyU7GUDmKtnKolExsqgBOdSTSU6etONy2hHgfrlY4SX3 w3y9/OkkjHUfJUEEdbLInLsNVHNrboCOPpIYKCnUJ8myhaaxPp0La0uKOzKMrif33JA5 dfyw== X-Gm-Message-State: AFqh2koOqk+py8GT0vApEkkhEPNCkk6lZmkwjR/Sio7CKqchbPJiHzjy 38LNAz1IkRNWPnf7RtKZ6lrXe0gddAI= X-Google-Smtp-Source: AMrXdXs29F0iyIf9MRCODAQbmPmP2d9pU1gWPBdnTE2PRXcNw1d8zc+w15TjL10LubrEOMnWhSTePMV2FM0= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:9393:6f7a:d410:55ca]) (user=surenb job=sendgmr) by 2002:a05:690c:299:b0:370:2d8c:8193 with SMTP id bf25-20020a05690c029900b003702d8c8193mr1225043ywb.221.1673297630870; Mon, 09 Jan 2023 12:53:50 -0800 (PST) Date: Mon, 9 Jan 2023 12:52:59 -0800 In-Reply-To: <20230109205336.3665937-1-surenb@google.com> Mime-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230109205336.3665937-5-surenb@google.com> Subject: [PATCH 04/41] 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, laurent.dufour@fr.ibm.com, paulmck@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, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@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-Queue-Id: A74FC1C000C X-Rsp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NbPOGWD1g8ICtgizvvHP/YoVc+nHWlakKY1jLEPQKrMaMkZr/61wptxQLCuSvuKG9Vv0LN1zmXAbq8z1uz/M5369DVc+FPRjEKfcE06/zWq0DJmr58B+WpeDLjh4dHkwchIixXdqBScpbe8JFmRHQifLuW0IeSVZ6PdYEXGvrS7nKce2zZD367jOOBxjgO6/c2XGzCMl1YDNBKrLil4a9fLNJUeMhq72rGs6UBrtDP37V6DnCpY8g9YVR9+tCcymc4r2i2ONd0hyfwT/Is0d2/guzoRPYUULkumVISLRZqLDxYSC2bdjvj4DN/IVm/Op7ZeTZbzDkn3flwVyOzN6X1jRSW+82nnQroZVgjZwOHT9oKTUg0KdDDH7O9ViXjKdoBvjIbAvAWZ6dnhyArq91sPS X-Bogosity: Ham, tests=bogofilter, spamicity=0.002250, 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 a11eea943f8d..d85291b19f86 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); }