From patchwork Sat Jan 5 17:48:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13827 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6741C23E21 for ; Sat, 5 Jan 2013 17:49:20 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 030D1A191C4 for ; Sat, 5 Jan 2013 17:49:19 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id p1so17977617vcq.10 for ; Sat, 05 Jan 2013 09:49:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-content-scanned:x-cbid:x-gm-message-state; bh=8P/mGT/FjgMMbAHEBr59EENmWyAiB2tJG742Nk+VshI=; b=WtdleHWtaUjVrgX6FA899UrHfyngxbJy6D+zQEcXJfyh9Vh4zhumOSE9IolQs5OLWF c2t5Hj8kYLQK0+oa8RfnRKNLQN1x4C2bDIC23qwuAyGMdGaEdFXPom6WYjxx5ibfQJYr JdbnKEjFn7h0dxvf8oniTx2/Gc7/h7TeYyXlx6dbSVRG1duGrEsrvGS0UzpIbBvRK7if u5BUHAdUMU3VEYLl2TGBs7XTPRCwRSSVjiMGmMLotwQdcokGxKopSsS4dwJifgfIxv/7 2wbfHbO6FpbSoj7KN9zqC5FJkAtuwxzEHUST4FwJN0aurIc04k8BOpleK4NgPyGWHMOG IR7g== X-Received: by 10.221.0.79 with SMTP id nl15mr79568008vcb.41.1357408159527; Sat, 05 Jan 2013 09:49:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp17428veb; Sat, 5 Jan 2013 09:49:19 -0800 (PST) X-Received: by 10.50.91.195 with SMTP id cg3mr1903655igb.57.1357408157676; Sat, 05 Jan 2013 09:49:17 -0800 (PST) Received: from e9.ny.us.ibm.com (e9.ny.us.ibm.com. [32.97.182.139]) by mx.google.com with ESMTPS id wo5si2706292igc.11.2013.01.05.09.49.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 05 Jan 2013 09:49:17 -0800 (PST) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.139 as permitted sender) client-ip=32.97.182.139; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.139 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 5 Jan 2013 12:49:16 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 5 Jan 2013 12:49:14 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id B98126E803A; Sat, 5 Jan 2013 12:49:12 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r05HnDbb359010; Sat, 5 Jan 2013 12:49:13 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r05Hn9uh032149; Sat, 5 Jan 2013 10:49:12 -0700 Received: from paulmck-ThinkPad-W500 ([9.80.23.97]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r05Hn8Kt032125; Sat, 5 Jan 2013 10:49:08 -0700 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id D7C10E4D82; Sat, 5 Jan 2013 09:49:05 -0800 (PST) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, edumazet@google.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, "Paul E. McKenney" , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 04/14] rcu: Provide compile-time control for no-CBs CPUs Date: Sat, 5 Jan 2013 09:48:54 -0800 Message-Id: <1357408144-15830-4-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1357408144-15830-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20130105174844.GA14172@linux.vnet.ibm.com> <1357408144-15830-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13010517-7182-0000-0000-000004367292 X-Gm-Message-State: ALoCoQlKSaO71ioh7xVby/J4Oa0jadfmIPOh2vkNeZ5KAZuxTwK4qAZidXFZJ9MGMYEGASc462Tz From: "Paul E. McKenney" Currently, the only way to specify no-CBs CPUs is via the rcu_nocbs kernel command-line parameter. This is inconvenient in some cases, particularly for randconfig testing, so this commit adds a new RCU_NOCB_CPU_DEFAULT kernel configuration parameter. Setting this new parameter to zero (the default) retains the old behavior, setting it to one offloads callback processing from CPU 0 (along with any other CPUs specified by the rcu_nocbs boot-time parameter), and setting it to two offloads callback processing from all CPUs. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- init/Kconfig | 13 +++++++++++++ kernel/rcutree_plugin.h | 13 +++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index fc6a3ca..35dcedb 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -676,6 +676,19 @@ config RCU_NOCB_CPU Say Y here if you want to help to debug reduced OS jitter. Say N here if you are unsure. +config RCU_NOCB_CPU_DEFAULT + int "Offload RCU callback processing from compile-selected CPUs" + depends on RCU_NOCB_CPU + range 0 2 + default 0 + help + Set this option to zero to only offload RCU callback processing + from those CPUs specified by the boot-time rcu_nocbs kernel + parameter. Set it to one to offload processing from CPU 0 + in addition to any CPUs specified at boot time. Set it to + two to offload processing from all CPUs, regardless of the + setting of the boot-time rcu_nocbs kernel parameter. + endmenu # "RCU Subsystem" config IKCONFIG diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 37750bc..eb9b473 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -86,6 +86,19 @@ static void __init rcu_bootup_announce_oddness(void) if (nr_cpu_ids != NR_CPUS) printk(KERN_INFO "\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); #ifdef CONFIG_RCU_NOCB_CPU +#if CONFIG_RCU_NOCB_CPU_DEFAULT != 0 + if (!have_rcu_nocb_mask) { + alloc_bootmem_cpumask_var(&rcu_nocb_mask); + have_rcu_nocb_mask = true; + } +#if CONFIG_RCU_NOCB_CPU_DEFAULT == 1 + pr_info("\tExperimental no-CBs CPU 0\n"); + cpumask_set_cpu(0, rcu_nocb_mask); +#else /* #if CONFIG_RCU_NOCB_CPU_DEFAULT == 1 */ + pr_info("\tExperimental no-CBs for all CPUs\n"); + cpumask_setall(rcu_nocb_mask); +#endif /* #else #if CONFIG_RCU_NOCB_CPU_DEFAULT == 1 */ +#endif /* #if CONFIG_RCU_NOCB_CPU_DEFAULT != 0 */ if (have_rcu_nocb_mask) { cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask); pr_info("\tExperimental no-CBs CPUs: %s.\n", nocb_buf);