From d1eb57c1af4723976dd9403e9bc8b3a8a2a11a7e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Jun 2014 09:34:40 -0400 Subject: [PATCH] 3.10-stable patches added patches: nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch --- ...-between-config_no_hz-n-and-nohz-off.patch | 42 +++++++++++++++++++ queue-3.10/series | 1 + 2 files changed, 43 insertions(+) create mode 100644 queue-3.10/nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch diff --git a/queue-3.10/nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch b/queue-3.10/nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch new file mode 100644 index 00000000000..2b74c564ae1 --- /dev/null +++ b/queue-3.10/nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch @@ -0,0 +1,42 @@ +From 0e576acbc1d9600cf2d9b4a141a2554639959d50 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Fri, 29 Nov 2013 12:18:13 +0100 +Subject: nohz: Fix another inconsistency between CONFIG_NO_HZ=n and nohz=off + +From: Thomas Gleixner + +commit 0e576acbc1d9600cf2d9b4a141a2554639959d50 upstream. + +If CONFIG_NO_HZ=n tick_nohz_get_sleep_length() returns NSEC_PER_SEC/HZ. + +If CONFIG_NO_HZ=y and the nohz functionality is disabled via the +command line option "nohz=off" or not enabled due to missing hardware +support, then tick_nohz_get_sleep_length() returns 0. That happens +because ts->sleep_length is never set in that case. + +Set it to NSEC_PER_SEC/HZ when the NOHZ mode is inactive. + +Reported-by: Michal Hocko +Reported-by: Borislav Petkov +Signed-off-by: Thomas Gleixner +Cc: Rui Xiang +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/tick-sched.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/time/tick-sched.c ++++ b/kernel/time/tick-sched.c +@@ -720,8 +720,10 @@ static bool can_stop_idle_tick(int cpu, + return false; + } + +- if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) ++ if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) { ++ ts->sleep_length = (ktime_t) { .tv64 = NSEC_PER_SEC/HZ }; + return false; ++ } + + if (need_resched()) + return false; diff --git a/queue-3.10/series b/queue-3.10/series index 6e528068d69..a8ba1c3b27b 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -41,3 +41,4 @@ staging-iio-tsl2x7x_core-fix-proximity-treshold.patch iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch iio-fix-endianness-issue-in-ak8975_read_axis.patch lzo-properly-check-for-overruns.patch +nohz-fix-another-inconsistency-between-config_no_hz-n-and-nohz-off.patch -- 2.47.3