diff --git a/[refs] b/[refs] index 9954e9b42910..fd0b9d2b5cad 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: af39241b90a345556b8884adff87096afe71b050 +refs/heads/master: 6409c4da289d6905f7ae2bd0630438368439bda2 diff --git a/trunk/kernel/sched_clock.c b/trunk/kernel/sched_clock.c index a0b0852414cc..db69174b1178 100644 --- a/trunk/kernel/sched_clock.c +++ b/trunk/kernel/sched_clock.c @@ -29,6 +29,7 @@ #include #include #include +#include /* * Scheduler clock - returns current time in nanosec units. @@ -151,6 +152,13 @@ u64 sched_clock_cpu(int cpu) struct sched_clock_data *scd = cpu_sdc(cpu); u64 now, clock, this_clock, remote_clock; + /* + * Normally this is not called in NMI context - but if it is, + * trying to do any locking here is totally lethal. + */ + if (unlikely(in_nmi())) + return scd->clock; + if (unlikely(!sched_clock_running)) return 0ull;