Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79713
b: refs/heads/master
c: 5ee613b
h: refs/heads/master
i:
  79711: 963696a
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent 6e597d7 commit 1a2c307
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53d517cdbaac704352b3d0c10fecb99e0b54572e
refs/heads/master: 5ee613b6751cd91db4b6bd7c1dc9d2f9cf65cde2
15 changes: 12 additions & 3 deletions trunk/arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,19 @@ void default_idle(void)
smp_mb();

local_irq_disable();
if (!need_resched())
if (!need_resched()) {
ktime_t t0, t1;
u64 t0n, t1n;

t0 = ktime_get();
t0n = ktime_to_ns(t0);
safe_halt(); /* enables interrupts racelessly */
else
local_irq_enable();
local_irq_disable();
t1 = ktime_get();
t1n = ktime_to_ns(t1);
sched_clock_idle_wakeup_event(t1n - t0n);
}
local_irq_enable();
current_thread_info()->status |= TS_POLLING;
} else {
/* loop is done by the caller */
Expand Down
13 changes: 10 additions & 3 deletions trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,16 @@ static void default_idle(void)
smp_mb();
local_irq_disable();
if (!need_resched()) {
/* Enables interrupts one instruction before HLT.
x86 special cases this so there is no race. */
safe_halt();
ktime_t t0, t1;
u64 t0n, t1n;

t0 = ktime_get();
t0n = ktime_to_ns(t0);
safe_halt(); /* enables interrupts racelessly */
local_irq_disable();
t1 = ktime_get();
t1n = ktime_to_ns(t1);
sched_clock_idle_wakeup_event(t1n - t0n);
} else
local_irq_enable();
current_thread_info()->status |= TS_POLLING;
Expand Down

0 comments on commit 1a2c307

Please sign in to comment.