diff options
author | Andi Kleen <ak@suse.de> | 2006-01-11 16:44:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 22:04:55 -0500 |
commit | 95833c83f3b812c78e48db4eaa19f6c74958470b (patch) | |
tree | 8ad17da708141d66cf53c2113b4fe1710af929ec /arch/x86_64/kernel/apic.c | |
parent | 6b050f8075823b0d9ec4fad38f4f552b74e5c5af (diff) |
[PATCH] x86_64: Add idle notifiers
This adds a new notifier chain that is called with IDLE_START
when a CPU goes idle and IDLE_END when it goes out of idle.
The context can be idle thread or interrupt context.
Since we cannot rely on MONITOR/MWAIT existing the idle
end check currently has to be done in all interrupt
handlers.
They were originally inspired by the similar s390 implementation.
They have a variety of applications:
- They will be needed for CONFIG_NO_IDLE_HZ
- They can be used for oprofile to fix up the missing time
in idle when performance counters don't tick.
- They can be used for better C state management in ACPI
- They could be used for microstate accounting.
This is just infrastructure so far, no users.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/apic.c')
-rw-r--r-- | arch/x86_64/kernel/apic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 40cbd60e2d0b..628aebf9f9aa 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/pgalloc.h> | 34 | #include <asm/pgalloc.h> |
35 | #include <asm/mach_apic.h> | 35 | #include <asm/mach_apic.h> |
36 | #include <asm/nmi.h> | 36 | #include <asm/nmi.h> |
37 | #include <asm/idle.h> | ||
37 | 38 | ||
38 | int apic_verbosity; | 39 | int apic_verbosity; |
39 | 40 | ||
@@ -922,6 +923,7 @@ void smp_apic_timer_interrupt(struct pt_regs *regs) | |||
922 | * Besides, if we don't timer interrupts ignore the global | 923 | * Besides, if we don't timer interrupts ignore the global |
923 | * interrupt lock, which is the WrongThing (tm) to do. | 924 | * interrupt lock, which is the WrongThing (tm) to do. |
924 | */ | 925 | */ |
926 | exit_idle(); | ||
925 | irq_enter(); | 927 | irq_enter(); |
926 | smp_local_timer_interrupt(regs); | 928 | smp_local_timer_interrupt(regs); |
927 | irq_exit(); | 929 | irq_exit(); |
@@ -981,6 +983,7 @@ __init int oem_force_hpet_timer(void) | |||
981 | asmlinkage void smp_spurious_interrupt(void) | 983 | asmlinkage void smp_spurious_interrupt(void) |
982 | { | 984 | { |
983 | unsigned int v; | 985 | unsigned int v; |
986 | exit_idle(); | ||
984 | irq_enter(); | 987 | irq_enter(); |
985 | /* | 988 | /* |
986 | * Check if this really is a spurious interrupt and ACK it | 989 | * Check if this really is a spurious interrupt and ACK it |
@@ -1016,6 +1019,7 @@ asmlinkage void smp_error_interrupt(void) | |||
1016 | { | 1019 | { |
1017 | unsigned int v, v1; | 1020 | unsigned int v, v1; |
1018 | 1021 | ||
1022 | exit_idle(); | ||
1019 | irq_enter(); | 1023 | irq_enter(); |
1020 | /* First tickle the hardware, only then report what went on. -- REW */ | 1024 | /* First tickle the hardware, only then report what went on. -- REW */ |
1021 | v = apic_read(APIC_ESR); | 1025 | v = apic_read(APIC_ESR); |