summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2013-12-17 13:23:07 -0800
committerViresh Kumar <viresh.kumar@linaro.org>2014-09-05 09:52:51 +0530
commit05fa05da1962663a5314aa78a9317ec282a43f23 (patch)
treec2fc9b211dd39fb5c8b6bfe7e0d519a485aec26f
parenta8bcaba5c5a3d0d95246a3920235a8fd8d88d2b7 (diff)
sched/nohz: add debugfs control over sched_tick_max_deferment
Allow debugfs override of sched_tick_max_deferment in order to ease finding/fixing the remaining issues with full nohz. The value to be written is in jiffies, and -1 means the max deferment is disabled (scheduler_tick_max_deferment() returns KTIME_MAX.) Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
-rw-r--r--kernel/sched/core.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1b20fc0ec4a7..3e632fe4a192 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2457,6 +2457,8 @@ void scheduler_tick(void)
}
#ifdef CONFIG_NO_HZ_FULL
+static u32 sched_tick_max_deferment = HZ;
+
/**
* scheduler_tick_max_deferment
*
@@ -2475,13 +2477,25 @@ u64 scheduler_tick_max_deferment(void)
struct rq *rq = this_rq();
unsigned long next, now = ACCESS_ONCE(jiffies);
- next = rq->last_sched_tick + HZ;
+ if (sched_tick_max_deferment == -1)
+ return KTIME_MAX;
+
+ next = rq->last_sched_tick + sched_tick_max_deferment;
if (time_before_eq(next, now))
return 0;
return jiffies_to_nsecs(next - now);
}
+
+static __init int sched_nohz_full_init_debug(void)
+{
+ debugfs_create_u32("sched_tick_max_deferment", 0644, NULL,
+ &sched_tick_max_deferment);
+
+ return 0;
+}
+late_initcall(sched_nohz_full_init_debug);
#endif
notrace unsigned long get_parent_ip(unsigned long addr)