From: Christoph Lameter <cl@linux.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Gilad Ben-Yossef <gilad@benyossef.com>, Tejun Heo <tj@kernel.org>,
John Stultz <john.stultz@linaro.org>,
Mike Frysinger <vapier@gentoo.org>,
Minchan Kim <minchan.kim@gmail.com>,
Hakan Akkan <hakanakkan@gmail.com>,
Max Krasnyansky <maxk@qti.qualcomm.com>,
Hugh Dickins <hughd@google.com>, "H. Peter Anvin" <hpa@zytor.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [NOHZ] Remove scheduler_tick_max_deferment
Date: Mon, 10 Nov 2014 12:26:51 -0600 (CST) [thread overview]
Message-ID: <alpine.DEB.2.11.1411101226310.12918@gentwo.org> (raw)
In-Reply-To: <20141110153147.GK4901@linux.vnet.ibm.com>
>
> Would it make sense for unlimited max deferment to be available as
> a boot parameter? That would allow people who want tick-free execution
> more than accurate stats to get that easily, while keeping stats accurate
> for everyone else.
Subject: Make the maximum tick deferral for CONFIG_NO_HZ configurable
Add a way to configure this interval at boot and via
/proc/sys/vm/max_defer_tick
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/kernel/sched/core.c
===================================================================
--- linux.orig/kernel/sched/core.c
+++ linux/kernel/sched/core.c
@@ -2574,6 +2574,17 @@ void scheduler_tick(void)
}
#ifdef CONFIG_NO_HZ_FULL
+int sysctl_max_defer_tick __read_mostly = 1;
+
+static int __init max_defer_tick_setup(char *str)
+{
+ sysctl_max_defer_tick = simple_strtol(str, NULL, 0);
+ pr_info("NO_HZ_FULL maxinum deferral of busy tick set to %d\n",
+ sysctl_max_defer_tick);
+ return 1;
+}
+__setup("max_defer_tick=", max_defer_tick_setup);
+
/**
* scheduler_tick_max_deferment
*
@@ -2592,7 +2603,7 @@ u64 scheduler_tick_max_deferment(void)
struct rq *rq = this_rq();
unsigned long next, now = ACCESS_ONCE(jiffies);
- next = rq->last_sched_tick + HZ;
+ next = rq->last_sched_tick + sysctl_max_defer_tick * HZ;
if (time_before_eq(next, now))
return 0;
Index: linux/kernel/sysctl.c
===================================================================
--- linux.orig/kernel/sysctl.c
+++ linux/kernel/sysctl.c
@@ -1407,6 +1407,15 @@ static struct ctl_table vm_table[] = {
.proc_handler = proc_dointvec_jiffies,
},
#endif
+#ifdef CONFIG_NO_HZ_FULL
+ {
+ .procname = "max_defer_tick",
+ .data = &sysctl_max_defer_tick,
+ .maxlen = sizeof(sysctl_max_defer_tick),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_jiffies,
+ },
+#endif
#ifdef CONFIG_MMU
{
.procname = "mmap_min_addr",
Index: linux/Documentation/sysctl/vm.txt
===================================================================
--- linux.orig/Documentation/sysctl/vm.txt
+++ linux/Documentation/sysctl/vm.txt
@@ -714,6 +714,13 @@ is 1 second.
==============================================================
+max_defer_tick
+
+The maximum time that the tick may be deferred while a process is
+monopolizing a cpu.
+
+==============================================================
+
swappiness
This control is used to define how aggressive the kernel will swap
Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -1876,6 +1876,10 @@ bytes respectively. Such letter suffixes
devices can be requested on-demand with the
/dev/loop-control interface.
+ max_defer_tick [NO_HZ_FULL] The number of seconds that the system may
+ defer the timer tick if a process is monopolizing the
+ cpu.
+
mce [X86-32] Machine Check Exception
mce=option [X86-64] See Documentation/x86/x86_64/boot-options.txt
Index: linux/include/linux/sched/sysctl.h
===================================================================
--- linux.orig/include/linux/sched/sysctl.h
+++ linux/include/linux/sched/sysctl.h
@@ -53,6 +53,10 @@ extern unsigned int sysctl_numa_balancin
extern unsigned int sysctl_numa_balancing_scan_period_max;
extern unsigned int sysctl_numa_balancing_scan_size;
+#ifdef CONFIG_NO_HZ_FULL
+extern int sysctl_max_defer_tick;
+#endif
+
#ifdef CONFIG_SCHED_DEBUG
extern unsigned int sysctl_sched_migration_cost;
extern unsigned int sysctl_sched_nr_migrate;
next prev parent reply other threads:[~2014-11-10 18:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 16:01 Christoph Lameter
2014-11-01 19:18 ` Thomas Gleixner
2014-11-01 21:52 ` Christoph Lameter
2014-11-01 22:33 ` Thomas Gleixner
2014-11-06 17:24 ` Christoph Lameter
2014-11-10 7:11 ` Viresh Kumar
2014-11-10 15:31 ` Paul E. McKenney
2014-11-10 16:21 ` Christoph Lameter
2014-11-10 18:26 ` Christoph Lameter [this message]
2014-11-11 17:15 ` Future of NOHZ full/isolation development (was Re: [NOHZ] Remove scheduler_tick_max_deferment) Frederic Weisbecker
2014-11-11 17:39 ` Paul E. McKenney
2014-11-11 18:00 ` Christoph Lameter
2014-11-12 6:11 ` Viresh Kumar
2014-11-12 13:54 ` Frederic Weisbecker
2014-11-12 14:56 ` Viresh Kumar
2014-11-12 15:06 ` Peter Zijlstra
2014-11-12 15:16 ` Viresh Kumar
2014-11-13 7:22 ` Viresh Kumar
2014-11-10 16:19 ` [NOHZ] Remove scheduler_tick_max_deferment Christoph Lameter
2014-11-10 22:43 ` Frederic Weisbecker
2014-11-11 14:58 ` Christoph Lameter
2014-11-11 15:36 ` Frederic Weisbecker
2014-11-11 17:08 ` Christoph Lameter
2014-11-10 20:26 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1411101226310.12918@gentwo.org \
--to=cl@linux.com \
--cc=fweisbec@gmail.com \
--cc=gilad@benyossef.com \
--cc=hakanakkan@gmail.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qti.qualcomm.com \
--cc=minchan.kim@gmail.com \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vapier@gentoo.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®