From patchwork Sun Nov 11 19:43:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 10677771 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 CD43B139B for ; Sun, 11 Nov 2018 19:44:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBF0F29D4D for ; Sun, 11 Nov 2018 19:44:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACECF29D78; Sun, 11 Nov 2018 19:44:27 +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 E4B3929D4D for ; Sun, 11 Nov 2018 19:44:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1434B6B0005; Sun, 11 Nov 2018 14:44:23 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0A20C6B0006; Sun, 11 Nov 2018 14:44:23 -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 E83646B0007; Sun, 11 Nov 2018 14:44:22 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 85F466B0005 for ; Sun, 11 Nov 2018 14:44:22 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id c12-v6so3759663ede.6 for ; Sun, 11 Nov 2018 11:44:22 -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:from:to:cc :subject:date:in-reply-to:references:message-id; bh=5lQ2k0njCMLkBKIt3guDZaU7uMU/sv+ZNPd1a4fw/lc=; b=b8DNcQZ7eJ7gU9OUb8wvKNkzUt5QL9zw+EMt3Oxq5OIQh1qBQrOlcZqmtwmeBOVmGa YE1bdaGJ96WDhA/PTwRnjEFo5BKN2DWvMGoYmjZlqTK4o1jC7l98Wbqwy2zXXgIcsQWt S4Mgzu8BW25dqQ3NQLluYLbCYZbsKwZ6/VVuiPrxgot7t+jSSKX/jagdTB402ROcX/cQ 9U1iA2B6zORa9m4cIYHvYgU6Uun9YbFfXWJBXFNeSpBXgU7vvLoDxz4bS2sFcHXEzWIt /5NiGJ1UznwJFOkaeTxufA26iX0DRQA1S7dX+eGgKOXZBcsNQgRoTDc27re5oggZLiK0 Zz+A== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of paulmck@linux.vnet.ibm.com) smtp.mailfrom=paulmck@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AGRZ1gLnRNiICGM+KR5nYzOUWtI/oWyYoTIM9DFToSh9UKfPAVZnNLk5 XUw5yKAu3mG6GeOhpREsbVq9njSR/D3Qd7YufScXSUzbS54fw0YMOoUkp5XcA4Vzd+9pMYd0ffk drVM+ncPOO9v1XeC0aviGR2n0rQng48Q9jKX+S48n5Mm6E/9EGU+btx5TW1jllOA= X-Received: by 2002:a17:906:1dd1:: with SMTP id v17-v6mr7576563ejh.148.1541965461820; Sun, 11 Nov 2018 11:44:21 -0800 (PST) X-Google-Smtp-Source: AJdET5f8e8uGG0QurAySCyfbGY4ykvcJUP3svcfjQhrK+vPaE9jVIyIAYnKeZ4dn9svQifAYuOAR X-Received: by 2002:a17:906:1dd1:: with SMTP id v17-v6mr7576537ejh.148.1541965460741; Sun, 11 Nov 2018 11:44:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541965460; cv=none; d=google.com; s=arc-20160816; b=aENMZ5vO7qQvL/MSC9/cZtdRBcgMOl3jpCAiYisJHITcyYWZfW7hDNQaFzR5UEAQ3Y gFdmdrzUcX+IS2kEyLNeyLClJPyIIimk6aaT9S/fsNZSkbbxY//mZru6arbMx7uqN9eX k05soGMYU+lLlRmOSMfDJ7rCw59NfY43t5qdF/O6FNQtWmiU/6j8mTz/QTGwWyWLupHo LLEgfPFkFjEW1sl0yBK4ccdk8Hnei5nke0uFyX/90UYjs32HhTB8PAmf4Fg6aIcaGqiN cQOKaFwD8A/dWg6jn+Mhnj6OEFlgcastvlpL734gqV9Klr5Q6YwqKWD5S6ZgFGCdut+E 9tog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=5lQ2k0njCMLkBKIt3guDZaU7uMU/sv+ZNPd1a4fw/lc=; b=MeXJUCRp5wfUdkYjjrIuccFOtlHnOHhxzt0Yj0YS93ylQSU44LND7Lavn2I0bCWejm ng5SxqQPbNS2282mZCCGEJXfXIe/b0OT0tOrkdDQ7/0cGskv2U6OanJRCDmTYmA4EQk6 UtI4z+5Vi6tbBq/kZ6z+w8o+0Z654+ftgk+aVCyOMRMzBIAWaIvnhFJxF80PlR0/gEAh SNlJUhjKahFsOB4g8Or0iPfTQkwhzramlXykPv60dfGSidTnr2BmYFIzjOkH/AokL7ub KYBxkx+/aeJVh1fdhsj6nT12WOs1pNzWfXEw/5+ZVEcxvAdtxJ9qj5h/uOgNJdUHGS1C p6Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of paulmck@linux.vnet.ibm.com) smtp.mailfrom=paulmck@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id o25-v6si2375968edt.64.2018.11.11.11.44.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 11:44:20 -0800 (PST) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of paulmck@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of paulmck@linux.vnet.ibm.com) smtp.mailfrom=paulmck@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wABJiAsw036616 for ; Sun, 11 Nov 2018 14:44:19 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2npdbnsp6b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 11 Nov 2018 14:44:19 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 11 Nov 2018 19:44:18 -0000 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 11 Nov 2018 19:44:13 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wABJiCMK40632328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 11 Nov 2018 19:44:12 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8BBF8B2064; Sun, 11 Nov 2018 19:44:12 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 544D0B2068; Sun, 11 Nov 2018 19:44:12 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.207.24]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sun, 11 Nov 2018 19:44:12 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 198B216C5D5F; Sun, 11 Nov 2018 11:44:13 -0800 (PST) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org Subject: [PATCH tip/core/rcu 28/41] slab: Replace synchronize_sched() with synchronize_rcu() Date: Sun, 11 Nov 2018 11:43:57 -0800 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181111194104.GA4787@linux.ibm.com> References: <20181111194104.GA4787@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18111119-0068-0000-0000-0000035E482E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010028; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01116019; UDB=6.00578732; IPR=6.00896120; MB=3.00024114; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-11 19:44:18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18111119-0069-0000-0000-000046644C6B Message-Id: <20181111194410.6368-28-paulmck@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-11_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811110188 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 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