From patchwork Tue Dec 4 22:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Kobe Wu X-Patchwork-Id: 10712693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E88AC109C for ; Tue, 4 Dec 2018 22:47:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6AC42A4D6 for ; Tue, 4 Dec 2018 22:47:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C80492BF9F; Tue, 4 Dec 2018 22:47:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13C532A4D6 for ; Tue, 4 Dec 2018 22:47:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 267A46B7117; Tue, 4 Dec 2018 17:47:12 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 216F66B7118; Tue, 4 Dec 2018 17:47:12 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 106446B7119; Tue, 4 Dec 2018 17:47:12 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id C443F6B7117 for ; Tue, 4 Dec 2018 17:47:11 -0500 (EST) Received: by mail-pg1-f198.google.com with SMTP id 143so9922119pgc.3 for ; Tue, 04 Dec 2018 14:47:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:sender :from:message-id:cc:reply-to:to:subject:git-commit-id:robot-id :robot-unsubscribe:mime-version:content-transfer-encoding :content-disposition:precedence; bh=TNkD0VXlL0RtRdF0wUuineTVkGk5XBnPDbriiIdcnRU=; b=VIoXo/EtvXEDbUDO+OT8wC/OeDD0ZUB0Fkatxj5KHeslrqsgqAaGKRalwRG80CKfVO cneCv04BeU0VNdYFkQWI4ZeK6Z3vU6et7/eJcO4wqWJ39f44Z3dZEf6HtbNCe87QS6Hf fbeZIDRPCFtasKmY75+XZFoziPeT31Byyr8JWyuOOm4BH9GkQBDmdkbkcKd4Vj4A4Rjx lEgX7W2H4guUCdDHi0P3n5yAwVJLR8eqb6n5XDp1WIkovKQ+ELTiJPINRKcZRRW6tg7O yfNahuYTtUBqTihMWAl+jcbDZ51DKsTQ1mR1bWI3elYFcHIbYvnf5c70RZIMOzg/eLfF JEdA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of tipbot@zytor.com designates 198.137.202.136 as permitted sender) smtp.mailfrom=tipbot@zytor.com X-Gm-Message-State: AA+aEWY4ZynYYQVrRubLrZbBp/jkxwTP0svk2fFqt+q+K7bqUEOuGGrp 6WbV936oDxirZnw+y5usT0YSlo45sU1IOyp+FnBX+mBhZ2z/QkLabxLAkp3vvgaflnFSFgJ5hON yE41IGoiiLImJKourOvB+VOxbutfl3eFJfSdYQQif2wnOPY3JmSY1ZTBfVEXnK2t4+w== X-Received: by 2002:a65:57cb:: with SMTP id q11mr18466397pgr.60.1543963631447; Tue, 04 Dec 2018 14:47:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/WyYPwSpHCMtD2BQdaREjvxC6RjpXReNhQSpHZj0jUiLIwh31EBU5qjXFdHj6P+7fiMjpDK X-Received: by 2002:a65:57cb:: with SMTP id q11mr18466363pgr.60.1543963630587; Tue, 04 Dec 2018 14:47:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543963630; cv=none; d=google.com; s=arc-20160816; b=tOHxJfdme/cefRz/YrizhnGrxc+d8dpcEzy99yXYn6Q31jQ1MHYL47nVpGqSgZIlj0 GN4ajRN6VeD3je/i3gQ3ktHTvfKISgTqfPP+ehxYJVpi54T0/UqJTsYT5vvc49OAziZ1 VHr8HG7oFKlkXMli/z15v706PStMTgyalBf3GXBxN6e6qttRnn11uamV16p82/fQI+ri vQJDOJk3Z880s2MgvhsPg80xToAPEStaQ3Frc+McTGaDS+Ey/slX08+VtQTQpxLa1uvI NGoJCXO1VS4FUleWhYHQmvs5b/juwaxBPzZFDgeMwXlcSrE+0xgDB48YicWYWTpZHPSL dbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=precedence:content-disposition:content-transfer-encoding :mime-version:robot-unsubscribe:robot-id:git-commit-id:subject:to :reply-to:cc:message-id:from:sender:date; bh=TNkD0VXlL0RtRdF0wUuineTVkGk5XBnPDbriiIdcnRU=; b=zkeEMoioTqxfJKITkiAVFqSDPBfhbU0pi60jspNfC9QEB4pL5QFnczVoX0Te3wpcDf hhWXYAn2yt5MSKivIqpKBrU6L4bHOh/8KYO5LgxzepVymSwTPuurJvDja5n0wFWMb9hj 0IHWh06IlztsS9xyEqR2qcsRfcDxqXhcqifSEMVjuGiqLeoeNQo7P3BKWHoKvbnxds72 lHZF3+fMQhndnW18u+RXGAqPsz3VqRXtRPWL17mP/1eYLEd0sx9gahvYG721GQPQWlJi 2j+Yds5hqx5F96q/4uV1iUWl+xj7IRqf1L/G9ntim41MBA/KzyiQV47NQS7GcgEfM1ph kYZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of tipbot@zytor.com designates 198.137.202.136 as permitted sender) smtp.mailfrom=tipbot@zytor.com Received: from terminus.zytor.com (terminus.zytor.com. [198.137.202.136]) by mx.google.com with ESMTPS id d1si17219626pla.412.2018.12.04.14.47.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 14:47:10 -0800 (PST) Received-SPF: pass (google.com: domain of tipbot@zytor.com designates 198.137.202.136 as permitted sender) client-ip=198.137.202.136; Authentication-Results: mx.google.com; spf=pass (google.com: domain of tipbot@zytor.com designates 198.137.202.136 as permitted sender) smtp.mailfrom=tipbot@zytor.com Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wB4Ml5bC1039905 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 4 Dec 2018 14:47:05 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wB4Ml4sZ1039902; Tue, 4 Dec 2018 14:47:04 -0800 Date: Tue, 4 Dec 2018 14:47:04 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: "tip-bot for Paul E. McKenney" Message-ID: Cc: iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, hpa@zytor.com, paulmck@linux.ibm.com, rientjes@google.com, mingo@kernel.org, penberg@kernel.org, tglx@linutronix.de, cl@linux.com Reply-To: tglx@linutronix.de, penberg@kernel.org, mingo@kernel.org, cl@linux.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, rientjes@google.com, paulmck@linux.ibm.com, hpa@zytor.com To: linux-tip-commits@vger.kernel.org Subject: [tip:core/rcu] slab: Replace synchronize_sched() with synchronize_rcu() Git-Commit-ID: 6564a25e6c185e65ca3148ed6e18f80882f6798f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Disposition: inline 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: X-Virus-Scanned: ClamAV using ClamSMTP Commit-ID: 6564a25e6c185e65ca3148ed6e18f80882f6798f Gitweb: https://git.kernel.org/tip/6564a25e6c185e65ca3148ed6e18f80882f6798f Author: Paul E. McKenney AuthorDate: Tue, 6 Nov 2018 19:24:33 -0800 Committer: Paul E. McKenney CommitDate: Tue, 27 Nov 2018 09:21:45 -0800 slab: Replace synchronize_sched() with synchronize_rcu() Now that synchronize_rcu() waits for preempt-disable regions of code as well as RCU read-side critical sections, synchronize_sched() can be replaced by synchronize_rcu(). This commit therefore makes this change. Signed-off-by: Paul E. McKenney Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: --- mm/slab.c | 4 ++-- mm/slab_common.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 2a5654bb3b3f..3abb9feb3818 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -962,10 +962,10 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, * To protect lockless access to n->shared during irq disabled context. * If n->shared isn't NULL in irq disabled context, accessing to it is * guaranteed to be valid until irq is re-enabled, because it will be - * freed after synchronize_sched(). + * freed after synchronize_rcu(). */ if (old_shared && force_change) - synchronize_sched(); + synchronize_rcu(); fail: kfree(old_shared); diff --git a/mm/slab_common.c b/mm/slab_common.c index 7eb8dc136c1c..9c11e8a937d2 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -724,7 +724,7 @@ void slab_deactivate_memcg_cache_rcu_sched(struct kmem_cache *s, css_get(&s->memcg_params.memcg->css); s->memcg_params.deact_fn = deact_fn; - call_rcu_sched(&s->memcg_params.deact_rcu_head, kmemcg_deactivate_rcufn); + call_rcu(&s->memcg_params.deact_rcu_head, kmemcg_deactivate_rcufn); } void memcg_deactivate_kmem_caches(struct mem_cgroup *memcg) @@ -839,11 +839,11 @@ static void flush_memcg_workqueue(struct kmem_cache *s) mutex_unlock(&slab_mutex); /* - * SLUB deactivates the kmem_caches through call_rcu_sched. Make + * SLUB deactivates the kmem_caches through call_rcu. Make * sure all registered rcu callbacks have been invoked. */ if (IS_ENABLED(CONFIG_SLUB)) - rcu_barrier_sched(); + rcu_barrier(); /* * SLAB and SLUB create memcg kmem_caches through workqueue and SLUB