Commit 543487c7a2670bb0d96c00673a44b74360e3b6c1

Authored by Steven Rostedt
Committed by Frederic Weisbecker
1 parent 3b2f64d00c

nohz: Do not warn about unstable tsc unless user uses nohz_full

If the user enables CONFIG_NO_HZ_FULL and runs the kernel on a machine
with an unstable TSC, it will produce a WARN_ON dump as well as taint
the kernel. This is a bit extreme for a kernel that just enables a
feature but doesn't use it.

The warning should only happen if the user tries to use the feature by
either adding nohz_full to the kernel command line, or by enabling
CONFIG_NO_HZ_FULL_ALL that makes nohz used on all CPUs at boot up. Note,
this second feature should not (yet) be used by distros or anyone that
doesn't care if NO_HZ is used or not.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

kernel/time/tick-sched.c
... ... @@ -182,7 +182,8 @@
182 182 * Don't allow the user to think they can get
183 183 * full NO_HZ with this machine.
184 184 */
185   - WARN_ONCE(1, "NO_HZ FULL will not work with unstable sched clock");
  185 + WARN_ONCE(have_nohz_full_mask,
  186 + "NO_HZ FULL will not work with unstable sched clock");
186 187 return false;
187 188 }
188 189 #endif