From patchwork Mon Feb 27 17:36:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13153967 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 DC845C64ED6 for ; Mon, 27 Feb 2023 17:36:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 752516B0080; Mon, 27 Feb 2023 12:36:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 703126B0081; Mon, 27 Feb 2023 12:36:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CB3F6B0082; Mon, 27 Feb 2023 12:36:50 -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 507F86B0080 for ; Mon, 27 Feb 2023 12:36:50 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 22BB9809ED for ; Mon, 27 Feb 2023 17:36:50 +0000 (UTC) X-FDA: 80513776980.22.BE68289 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf16.hostedemail.com (Postfix) with ESMTP id 3F08A180020 for ; Mon, 27 Feb 2023 17:36:48 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=cLE4KbCr; spf=pass (imf16.hostedemail.com: domain of 3L-r8YwYKCB4MOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3L-r8YwYKCB4MOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@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=1677519408; 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=fnkDgHrJ0cqyk4yVnPbndf59jVemOaMLlO/iS92oZbE=; b=INGh4Diu/uS7KzfSYxGLADmDUS1aau4IJ6r/GbiHeO6XF8ffEpy6GxOnEAuz3nnoPE5eLi WtW5ecixfU+5Z8cxPsRNaUgD/uUvPDUqPfZseJYmWYzrVLjosq2Uu0lSaJeUieSfwoDjbd GM9S5MgZ5CHSRpbyWAs1kVqiv49ZjBk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=cLE4KbCr; spf=pass (imf16.hostedemail.com: domain of 3L-r8YwYKCB4MOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3L-r8YwYKCB4MOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677519408; a=rsa-sha256; cv=none; b=kUHTDCx8r0FKgLSdFesqivjBk2vbHgTR3JzNiU0eeY/JCmW5z5CuGx8EGQcOLW5AFgAyGK RYWugLlBXQzSv0IYUC8A3u4fmoyDQeFGaiVNWOj5oUryH/chNcGzmo/ZcDiSIV8bT5Huyo sGhLDnvZZ74PXN7vha88SlEefOlR5YA= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-536bbaa701aso152698917b3.3 for ; Mon, 27 Feb 2023 09:36:47 -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=fnkDgHrJ0cqyk4yVnPbndf59jVemOaMLlO/iS92oZbE=; b=cLE4KbCrSo3Ipu4g+yzfkRmcncyjiA+PVjyxhSlE0CxpbROsbbX5H0DHpPWYcZcUvL IgBczq5t3IK+5ladr1TbWOx/+SU8LSbf8Yx9jr8PkelvEstvvhZXeX43s6JTSESoyEye 3OJvntBP7bSxCk5pBrTwRFBtDhh/o6VDU9KVAovEJZ9n4EduivQuGfxt0pt6fskiyQUB zHwyjGzqyAJgiciJUq8aC5hSo+rK3+lmuiggplyhk0zrZZEyghcsffT9pFo2TSF/swmL j04i+/EYbcR8DTa/IGgGuaUtWO9uflgS4pwivCZBPdFnqw+L6jKJzSVJqswEg+Tmf1nw 9kkQ== 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=fnkDgHrJ0cqyk4yVnPbndf59jVemOaMLlO/iS92oZbE=; b=vYVltP9ej/TtyB8M19ijqmK7iG5zCrWhg59tyhkwcfLweVL+j6hz0ZNGKzVz9Gi0NH BJpCjI++gcIXz41/N3m2A5k0xTxXvMTCe+rm6Npn7juL7SVnkz2XxYRRl32Ukz4bW1c+ Eo1IFMS9W9S6wQOk6fy6/AkxBvYx19f089U08NWag0KGsB/FdRBl9ITU+71D4huKN42x /kxOCoYAkyUf1hxVYd5vPfJQmSGvwWDn28bEgflXXDMmFNoERjL+4adUdRxOhJ5TPcsm KhuX9Yr8bo8YoMF2zc4AdTmLNyheip3yfy1NORzlhB6wrV7sJVmv3eIXEQ4rpyzbgR9F k1Pw== X-Gm-Message-State: AO0yUKU7o8xovMeD6RF0o38HhPzDHKjjdeqbFYYK9gK33qmFRLh2f0b4 EJwIVnHd/x8HWaRox4E/dbMxrvCdRK4= X-Google-Smtp-Source: AK7set9OxVnGQxF1LzHrZxP47amBuaMy7ZRonNPJ1uJTtUoNYZIGL83gP4W8p3rUFsPEboBNOudLGUD3TJ0= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:e1f6:21d1:eead:3897]) (user=surenb job=sendgmr) by 2002:a05:6902:34f:b0:a35:f3f2:7deb with SMTP id e15-20020a056902034f00b00a35f3f27debmr14636ybs.250.1677519407298; Mon, 27 Feb 2023 09:36:47 -0800 (PST) Date: Mon, 27 Feb 2023 09:36:03 -0800 In-Reply-To: <20230227173632.3292573-1-surenb@google.com> Mime-Version: 1.0 References: <20230227173632.3292573-1-surenb@google.com> X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog Message-ID: <20230227173632.3292573-5-surenb@google.com> Subject: [PATCH v4 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, chriscli@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, michalechner92@googlemail.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, Liam Howlett , Suren Baghdasaryan X-Rspamd-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d17/z9SCEBUTi6usekqvF LLfx1CUA r7thTYBFv4rBhkU7sYwsYkMLcqZfY5Y4il1vIe44I0CgDT3ZBPeEiBQzNkgRKpAWgXWH5pkmZH/j+6VZWg/QHEdQgBZlxxrg4YzY076oXE2gfStEiSM+Byk7bzCwZlVteWzctNIVUMgDANkheYZA83BKdmFVxo9pL4Fvs1wsqODW22DUZbvtgF4OW78rh5pgmGy8okZRPwVi5aXuhelQaqcJZV6TQC04Os6Z1TEhKJsjgQmVdMC6u5SJjBVxzdtSzWouMIzD8DFv4hLMQ0HmqTroPyyMHuCeZe/SYaF6vdb55Ws6XqCcdiPn8cbRhKXfVfXtIW3tEV1brjSrU9FfscmUMdWiPSZErJlbke803Y9yD3xbSkRAXt8/G0QGGoRVQXUZbojeIbqNwPltSebrVz9X9tOT56pJcfMTVm9k0PxmoVT8K8bf8hvgdm1CDGK3gypIjWIYMkIrEWDT76VcnrYIg38oICU7ItnZsRLde1n3RwXQhZOxyzAgeDBiBWdVhmp7WwDm/hKegV9HqmWmGjcQIXp6BlIOFpVyqG0frZNRMU+Ow3f+LX0rmEHbhgaBIeRbuxgnZFoCIBiucsQCcXsa6rKw4CJwnl8Ev9QMHzJumEPFY4jTrqu5TBFOf1BpdLSWPmGw5lc0zdqxnx6/aBjxT5HA/z2vJB9k8d/TEbtxmieY2KFyIIntjnazUDsGSULoK 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 44d6ce30b28e..3d5ab02f981a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5517,7 +5517,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); }