Received: by 10.192.165.148 with SMTP id m20csp2928117imm; Sun, 22 Apr 2018 19:33:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49tB+/GFYkjk1GJdTcwtnHaT90j+UDKtAVgrYs/tM3L6wL11YW/Ovu5pd+xcmz8ew1LB1Tj X-Received: by 10.99.109.203 with SMTP id i194mr15064457pgc.402.1524450783672; Sun, 22 Apr 2018 19:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524450783; cv=none; d=google.com; s=arc-20160816; b=tpJuiL7/xFQt0lC4WzN+ZowkadgdB7thfI6SPnLfia6sHxokjHqvzCfR64VBP5LAm+ iLINRwJWnuqVRwHe2BKwUes1DGcli8NowPfD97VoZ0U7mGOSNRPq4OQxe/cB5OGWCEJT xaED9uEUH4KjFqngFFQHsEyy/pNf2ily6iBXQbPoawSrlCfKIEpPWElf+wlCuhpLH4t+ c1QHVtSm0AchGuj/aUdI9oRyA73NGf+LVnLmoN5jkGEFoNRkrWyogwYo5Y4UsKz3Sprv 8vXYdS7+SeAx5gu/Zju+9cK8lxQebe6z+FIsWbI0PjDHyJysULvGibwPdFg/CrxeQi+A tadg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=pmQxzOCRHki8BSEztANz1I2RPSSsLIQOLqjjvGEXZIs=; b=CkqizOs9ZmelXi0sljR03yHmpEq1dGzAmuztcEruo5dt0OW6NmzJiO0u7az5YtYGxX dk4M1shuV/ET5vp3ZLwmhM/z2PYcUg9NBQdyoq80EAztdaG+HB5e7G7zorA0GnWsgaGF BWgrWHWoSlR+Jx/6hHuasIbOq60PG6J4Zo0tARW526IbaN570vvXk0cFSVaM3QA/1vRV HxrQHIx2mYJ0c9i9SsmylgEpvf4Fs6ogvktnrQBelpUxUT8rQTrfcQ7FIsneOI//Wrg2 7EdPHkJUHf4/V0QYEp6tZv/njeHGLoWwXqRTKGZcey7N7VGKgvH154o4ZCM9T31UX6CC P5uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si10519194plg.236.2018.04.22.19.32.49; Sun, 22 Apr 2018 19:33:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754009AbeDWCb0 (ORCPT + 99 others); Sun, 22 Apr 2018 22:31:26 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58774 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753932AbeDWCbV (ORCPT ); Sun, 22 Apr 2018 22:31:21 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3N2UM4W039071 for ; Sun, 22 Apr 2018 22:31:21 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hh45wmes1-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 22 Apr 2018 22:31:21 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 22 Apr 2018 22:31:20 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 22 Apr 2018 22:31:15 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3N2VEq748365620; Mon, 23 Apr 2018 02:31:14 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A63A2B2058; Sun, 22 Apr 2018 23:33:17 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.149.45]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 69D6CB2050; Sun, 22 Apr 2018 23:33:17 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 656B616C83CA; Sun, 22 Apr 2018 19:32:28 -0700 (PDT) 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.opensrc@gmail.com, Byungchul Park , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 02/22] rcu: Inline rcu_preempt_do_callback() into its sole caller Date: Sun, 22 Apr 2018 19:32:07 -0700 X-Mailer: git-send-email 2.5.2 In-Reply-To: <20180423023150.GA21533@linux.vnet.ibm.com> References: <20180423023150.GA21533@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18042302-0024-0000-0000-0000034CCE30 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008903; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01021888; UDB=6.00521536; IPR=6.00801123; MB=3.00020719; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-23 02:31:19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042302-0025-0000-0000-000047C2DB4A Message-Id: <1524450747-22778-2-git-send-email-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_01:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804230025 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Byungchul Park The rcu_preempt_do_callbacks() function was introduced in commit 09223371dea(rcu: Use softirq to address performance regression), where it was necessary to handle kernel builds both containing and not containing RCU-preempt. Since then, various changes (most notably f8b7fc6b51 ("rcu: use softirq instead of kthreads except when RCU_BOOST=y")) have resulted in this function being invoked only from rcu_kthread_do_work(), which is present only in kernels containing RCU-preempt, which in turn means that the rcu_preempt_do_callbacks() function is no longer needed. This commit therefore inlines rcu_preempt_do_callbacks() into its sole remaining caller and also removes the rcu_state_p and rcu_data_p indirection for added clarity. Signed-off-by: Byungchul Park Reviewed-by: Steven Rostedt (VMware) [ paulmck: Remove the rcu_state_p and rcu_data_p indirection. ] Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.h | 1 - kernel/rcu/tree_plugin.h | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index f491ab4f2e8e..3a0dc30100e8 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -438,7 +438,6 @@ static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); static void invoke_rcu_callbacks_kthread(void); static bool rcu_is_callbacks_kthread(void); #ifdef CONFIG_RCU_BOOST -static void rcu_preempt_do_callbacks(void); static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); #endif /* #ifdef CONFIG_RCU_BOOST */ diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 84fbee4686d3..6c5df18bbf2f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -685,15 +685,6 @@ static void rcu_preempt_check_callbacks(void) t->rcu_read_unlock_special.b.need_qs = true; } -#ifdef CONFIG_RCU_BOOST - -static void rcu_preempt_do_callbacks(void) -{ - rcu_do_batch(rcu_state_p, this_cpu_ptr(rcu_data_p)); -} - -#endif /* #ifdef CONFIG_RCU_BOOST */ - /** * call_rcu() - Queue an RCU callback for invocation after a grace period. * @head: structure to be used for queueing the RCU updates. @@ -1140,7 +1131,7 @@ static void rcu_kthread_do_work(void) { rcu_do_batch(&rcu_sched_state, this_cpu_ptr(&rcu_sched_data)); rcu_do_batch(&rcu_bh_state, this_cpu_ptr(&rcu_bh_data)); - rcu_preempt_do_callbacks(); + rcu_do_batch(&rcu_preempt_state, this_cpu_ptr(&rcu_preempt_data)); } static void rcu_cpu_kthread_setup(unsigned int cpu) -- 2.5.2