From patchwork Sat Jan 5 17:48:56 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: 13834 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 0FA2623E21 for ; Sat, 5 Jan 2013 17:49:26 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by fiordland.canonical.com (Postfix) with ESMTP id A833DA19697 for ; Sat, 5 Jan 2013 17:49:25 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id l6so3817928vcl.23 for ; Sat, 05 Jan 2013 09:49:25 -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=YrWyInWcIEhG1eXzDgSPEDRYUsrzBpngoCgK6b4ZP64=; b=Wuu2uGQfFL8t45JSSVNrJECxh8O0Y2jrx/K5Ei4uNCcti+c6c78ozCmpQsoL7PIH96 lyQiF5eEol4sSTg2Sa4vEBhb43gnGHDSQroVEm0bv7uSLwKy556S3KGzz0lKp8YWo/FE Her4gKFL17BLlrUBc3LFxzbTQBjzKlS9e8ocxjfuq3IjreaCfZoEV/ZP2TrsN8XdjJ/A gTBMfOlnkzMbByPk0RLMf1t0YCz1NVV5RQou62zVaPnZ5NzTZsZE3eYR7CIylFkLINXZ I03h/4r+YarioUbqU/+pAPK1SmS4tFgHGQz3yugkrbCFs0yXWQo1hBbNW+l7ct6SoGo6 FJpQ== X-Received: by 10.52.70.205 with SMTP id o13mr69159012vdu.75.1357408165165; Sat, 05 Jan 2013 09:49:25 -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 st5csp17437veb; Sat, 5 Jan 2013 09:49:24 -0800 (PST) X-Received: by 10.50.41.200 with SMTP id h8mr1952833igl.0.1357408162593; Sat, 05 Jan 2013 09:49:22 -0800 (PST) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com. [32.97.110.154]) by mx.google.com with ESMTPS id kp9si2688410igc.45.2013.01.05.09.49.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 05 Jan 2013 09:49:22 -0800 (PST) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) client-ip=32.97.110.154; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 5 Jan 2013 10:49:21 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 5 Jan 2013 10:49:19 -0700 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id B0EF019D8043; Sat, 5 Jan 2013 10:49:18 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r05HnH35229526; Sat, 5 Jan 2013 10:49:17 -0700 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 r05HnCQm032327; Sat, 5 Jan 2013 10:49:14 -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 r05HnAuR032180; Sat, 5 Jan 2013 10:49:10 -0700 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 0E555E4D9A; Sat, 5 Jan 2013 09:49:06 -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 06/14] rcu: Export RCU_FAST_NO_HZ parameters to sysfs Date: Sat, 5 Jan 2013 09:48:56 -0800 Message-Id: <1357408144-15830-6-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-7606-0000-0000-00000726CA6F X-Gm-Message-State: ALoCoQlgu7P3ngf/R743Z3DNZonta8c7zd0zjov08lpJFfyQk3R+iJ+dXADJbwfiSI51Y5fjP5TB From: "Paul E. McKenney" RCU_FAST_NO_HZ operation is controlled by four compile-time C-preprocessor macros, but some use cases benefit greatly from runtime adjustment, particularly when tuning devices. This commit therefore creates the corresponding sysfs entries. Reported-by: Robin Randhawa Signed-off-by: Paul E. McKenney --- kernel/rcutree_plugin.h | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index ab1bdde..0997e9f 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -1617,6 +1617,15 @@ static void rcu_idle_count_callbacks_posted(void) #define RCU_IDLE_GP_DELAY 4 /* Roughly one grace period. */ #define RCU_IDLE_LAZY_GP_DELAY (6 * HZ) /* Roughly six seconds. */ +static int rcu_idle_flushes = RCU_IDLE_FLUSHES; +module_param(rcu_idle_flushes, int, 0644); +static int rcu_idle_opt_flushes = RCU_IDLE_OPT_FLUSHES; +module_param(rcu_idle_opt_flushes, int, 0644); +static int rcu_idle_gp_delay = RCU_IDLE_GP_DELAY; +module_param(rcu_idle_gp_delay, int, 0644); +static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY; +module_param(rcu_idle_lazy_gp_delay, int, 0644); + extern int tick_nohz_enabled; /* @@ -1696,10 +1705,10 @@ int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) } /* Set up for the possibility that RCU will post a timer. */ if (rcu_cpu_has_nonlazy_callbacks(cpu)) { - *delta_jiffies = round_up(RCU_IDLE_GP_DELAY + jiffies, - RCU_IDLE_GP_DELAY) - jiffies; + *delta_jiffies = round_up(rcu_idle_gp_delay + jiffies, + rcu_idle_gp_delay) - jiffies; } else { - *delta_jiffies = jiffies + RCU_IDLE_LAZY_GP_DELAY; + *delta_jiffies = jiffies + rcu_idle_lazy_gp_delay; *delta_jiffies = round_jiffies(*delta_jiffies) - jiffies; } return 0; @@ -1805,11 +1814,11 @@ static void rcu_prepare_for_idle(int cpu) if (rcu_cpu_has_nonlazy_callbacks(cpu)) { trace_rcu_prep_idle("User dyntick with callbacks"); rdtp->idle_gp_timer_expires = - round_up(jiffies + RCU_IDLE_GP_DELAY, - RCU_IDLE_GP_DELAY); + round_up(jiffies + rcu_idle_gp_delay, + rcu_idle_gp_delay); } else if (rcu_cpu_has_callbacks(cpu)) { rdtp->idle_gp_timer_expires = - round_jiffies(jiffies + RCU_IDLE_LAZY_GP_DELAY); + round_jiffies(jiffies + rcu_idle_lazy_gp_delay); trace_rcu_prep_idle("User dyntick with lazy callbacks"); } else { return; @@ -1861,8 +1870,8 @@ static void rcu_prepare_for_idle(int cpu) /* Check and update the ->dyntick_drain sequencing. */ if (rdtp->dyntick_drain <= 0) { /* First time through, initialize the counter. */ - rdtp->dyntick_drain = RCU_IDLE_FLUSHES; - } else if (rdtp->dyntick_drain <= RCU_IDLE_OPT_FLUSHES && + rdtp->dyntick_drain = rcu_idle_flushes; + } else if (rdtp->dyntick_drain <= rcu_idle_opt_flushes && !rcu_pending(cpu) && !local_softirq_pending()) { /* Can we go dyntick-idle despite still having callbacks? */ @@ -1871,11 +1880,11 @@ static void rcu_prepare_for_idle(int cpu) if (rcu_cpu_has_nonlazy_callbacks(cpu)) { trace_rcu_prep_idle("Dyntick with callbacks"); rdtp->idle_gp_timer_expires = - round_up(jiffies + RCU_IDLE_GP_DELAY, - RCU_IDLE_GP_DELAY); + round_up(jiffies + rcu_idle_gp_delay, + rcu_idle_gp_delay); } else { rdtp->idle_gp_timer_expires = - round_jiffies(jiffies + RCU_IDLE_LAZY_GP_DELAY); + round_jiffies(jiffies + rcu_idle_lazy_gp_delay); trace_rcu_prep_idle("Dyntick with lazy callbacks"); } tp = &rdtp->idle_gp_timer;