Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140806
b: refs/heads/master
c: 6409c4d
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Feb 26, 2009
1 parent f9f88dc commit b5e9251
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af39241b90a345556b8884adff87096afe71b050
refs/heads/master: 6409c4da289d6905f7ae2bd0630438368439bda2
8 changes: 8 additions & 0 deletions trunk/kernel/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/spinlock.h>
#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/hardirq.h>

/*
* Scheduler clock - returns current time in nanosec units.
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit b5e9251

Please sign in to comment.