Files
Linux/include/linux
Peter Zijlstra acb04058de sched/clock: Fix hotplug crash
Mike reported that he could trigger the WARN_ON_ONCE() in
set_sched_clock_stable() using hotplug.

This exposed a fundamental problem with the interface, we should never
mark the TSC stable if we ever find it to be unstable. Therefore
set_sched_clock_stable() is a broken interface.

The reason it existed is that not having it is a pain, it means all
relevant architecture code needs to call clear_sched_clock_stable()
where appropriate.

Of the three architectures that select HAVE_UNSTABLE_SCHED_CLOCK ia64
and parisc are trivial in that they never called
set_sched_clock_stable(), so add an unconditional call to
clear_sched_clock_stable() to them.

For x86 the story is a lot more involved, and what this patch tries to
do is ensure we preserve the status quo. So even is Cyrix or Transmeta
have usable TSC they never called set_sched_clock_stable() so they now
get an explicit mark unstable.

Reported-by: Mike Galbraith <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: 9881b024b7 ("sched/clock: Delay switching sched_clock to stable")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
2017-01-20 02:38:46 +01:00
..
…
…
…
…
2016-11-17 23:19:00 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-22 22:58:37 -05:00
…
…
…
…
2016-10-19 14:34:36 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-08 13:31:11 -05:00
2016-12-17 21:27:44 -05:00
…
…
…
…
…
…
…
…
2016-10-25 11:08:28 +08:00
…
…
…
2016-12-08 16:37:33 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-05 19:01:16 -05:00
…
…
…
…
…
…
…
2016-10-28 08:48:16 -06:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-11-25 10:15:13 -08:00
…
…
…
…
…
…
…
2016-12-05 19:01:16 -05:00
…
…
…
…
…
…
…
…
…
…
…
2016-12-25 17:21:22 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-25 17:21:22 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-11-30 14:36:01 +11:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-12 18:55:06 -08:00
2016-12-25 17:21:23 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-06 11:05:46 +01:00
…
…
…
…
…
…
…
…
…
2016-12-16 00:13:41 +02:00
2016-11-26 11:18:02 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-11-16 18:32:02 -05:00
…
2016-12-19 17:29:44 -05:00
…
…
…
…
…
…
…
…
…
2016-12-12 18:55:07 -08:00
…
…
…
…
2016-11-10 17:03:35 +01:00
…
…
…
…
…
…
…
2016-12-06 10:17:03 +02:00
…
…
…
…
…
…
…
…
…
2016-12-08 14:21:47 -05:00
…
2016-10-31 16:18:30 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-11-15 16:34:27 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-10-31 15:45:18 -07:00
…
…
…
…
…
…
…
…
2017-01-20 02:38:46 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-01-10 18:31:55 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-25 17:21:22 +01:00
…
…
…
2017-01-10 18:31:55 -08:00
…
…
…
…
…
…
…
…
2016-12-09 22:12:21 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-12 18:55:08 -08:00
…
…
…
…
2016-12-25 17:21:22 +01:00
…
…
…
…
…
…
…
…
…
…
…