Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35958
b: refs/heads/master
c: a15da49
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 26, 2006
1 parent abbcc8e commit 84bb469
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 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: 1c9c0a6ca35e9325cea811d734d6ab7352be086b
refs/heads/master: a15da49debaf7f09460a886b0ecd08588410715e
15 changes: 9 additions & 6 deletions trunk/arch/x86_64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,25 @@ void idle_notifier_unregister(struct notifier_block *n)
}
EXPORT_SYMBOL(idle_notifier_unregister);

enum idle_state { CPU_IDLE, CPU_NOT_IDLE };
static DEFINE_PER_CPU(enum idle_state, idle_state) = CPU_NOT_IDLE;

void enter_idle(void)
{
__get_cpu_var(idle_state) = CPU_IDLE;
write_pda(isidle, 1);
atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
}

static void __exit_idle(void)
{
__get_cpu_var(idle_state) = CPU_NOT_IDLE;
if (read_pda(isidle) == 0)
return;
write_pda(isidle, 0);
atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
}

/* Called from interrupts to signify idle end */
void exit_idle(void)
{
if (current->pid | read_pda(irqcount))
/* idle loop has pid 0 */
if (current->pid)
return;
__exit_idle();
}
Expand Down Expand Up @@ -220,6 +220,9 @@ void cpu_idle (void)
play_dead();
enter_idle();
idle();
/* In many cases the interrupt that ended idle
has already called exit_idle. But some idle
loops can be woken up without interrupt. */
__exit_idle();
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/include/asm-x86_64/pda.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct x8664_pda {
int nodenumber; /* number of current node */
unsigned int __softirq_pending;
unsigned int __nmi_count; /* number of NMI on this CPUs */
int mmu_state;
short mmu_state;
short isidle;
struct mm_struct *active_mm;
unsigned apic_timer_irqs;
} ____cacheline_aligned_in_smp;
Expand Down

0 comments on commit 84bb469

Please sign in to comment.