diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 23:15:18 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 23:15:18 -0500 |
| commit | dc8e7e3ec60bd5ef7868aa88755e9d4c948dc5cc (patch) | |
| tree | df6b7002b3672dcd269a5bc1473413f50a12df29 /arch/x86/kernel | |
| parent | 2c79c69adc6205fd115e4b1980c979e1e0e1828a (diff) | |
| parent | 43952886f0b8b3c344c3392b88de067d5fa5419a (diff) | |
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
cpuidle/x86/perf: fix power:cpu_idle double end events and throw cpu_idle events from the cpuidle layer
intel_idle: open broadcast clock event
cpuidle: CPUIDLE_FLAG_CHECK_BM is omap3_idle specific
cpuidle: CPUIDLE_FLAG_TLB_FLUSHED is specific to intel_idle
cpuidle: delete unused CPUIDLE_FLAG_SHALLOW, BALANCED, DEEP definitions
SH, cpuidle: delete use of NOP CPUIDLE_FLAGS_SHALLOW
cpuidle: delete NOP CPUIDLE_FLAG_POLL
ACPI: processor_idle: delete use of NOP CPUIDLE_FLAGs
cpuidle: Rename X86 specific idle poll state[0] from C0 to POLL
ACPI, intel_idle: Cleanup idle= internal variables
cpuidle: Make cpuidle_enable_device() call poll_idle_init()
intel_idle: update Sandy Bridge core C-state residency targets
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/process.c | 30 | ||||
| -rw-r--r-- | arch/x86/kernel/process_32.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/process_64.c | 6 |
3 files changed, 12 insertions, 28 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 09c08a1c706f..d8286ed54ffa 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -22,11 +22,6 @@ | |||
| 22 | #include <asm/i387.h> | 22 | #include <asm/i387.h> |
| 23 | #include <asm/debugreg.h> | 23 | #include <asm/debugreg.h> |
| 24 | 24 | ||
| 25 | unsigned long idle_halt; | ||
| 26 | EXPORT_SYMBOL(idle_halt); | ||
| 27 | unsigned long idle_nomwait; | ||
| 28 | EXPORT_SYMBOL(idle_nomwait); | ||
| 29 | |||
| 30 | struct kmem_cache *task_xstate_cachep; | 25 | struct kmem_cache *task_xstate_cachep; |
| 31 | EXPORT_SYMBOL_GPL(task_xstate_cachep); | 26 | EXPORT_SYMBOL_GPL(task_xstate_cachep); |
| 32 | 27 | ||
| @@ -327,7 +322,7 @@ long sys_execve(const char __user *name, | |||
| 327 | /* | 322 | /* |
| 328 | * Idle related variables and functions | 323 | * Idle related variables and functions |
| 329 | */ | 324 | */ |
| 330 | unsigned long boot_option_idle_override = 0; | 325 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; |
| 331 | EXPORT_SYMBOL(boot_option_idle_override); | 326 | EXPORT_SYMBOL(boot_option_idle_override); |
| 332 | 327 | ||
| 333 | /* | 328 | /* |
| @@ -386,6 +381,8 @@ void default_idle(void) | |||
| 386 | else | 381 | else |
| 387 | local_irq_enable(); | 382 | local_irq_enable(); |
| 388 | current_thread_info()->status |= TS_POLLING; | 383 | current_thread_info()->status |= TS_POLLING; |
| 384 | trace_power_end(smp_processor_id()); | ||
| 385 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); | ||
| 389 | } else { | 386 | } else { |
| 390 | local_irq_enable(); | 387 | local_irq_enable(); |
| 391 | /* loop is done by the caller */ | 388 | /* loop is done by the caller */ |
| @@ -443,8 +440,6 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); | |||
| 443 | */ | 440 | */ |
| 444 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | 441 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) |
| 445 | { | 442 | { |
| 446 | trace_power_start(POWER_CSTATE, (ax>>4)+1, smp_processor_id()); | ||
| 447 | trace_cpu_idle((ax>>4)+1, smp_processor_id()); | ||
| 448 | if (!need_resched()) { | 443 | if (!need_resched()) { |
| 449 | if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_CLFLUSH_MONITOR)) | 444 | if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_CLFLUSH_MONITOR)) |
| 450 | clflush((void *)¤t_thread_info()->flags); | 445 | clflush((void *)¤t_thread_info()->flags); |
| @@ -471,6 +466,8 @@ static void mwait_idle(void) | |||
| 471 | __sti_mwait(0, 0); | 466 | __sti_mwait(0, 0); |
| 472 | else | 467 | else |
| 473 | local_irq_enable(); | 468 | local_irq_enable(); |
| 469 | trace_power_end(smp_processor_id()); | ||
| 470 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); | ||
| 474 | } else | 471 | } else |
| 475 | local_irq_enable(); | 472 | local_irq_enable(); |
| 476 | } | 473 | } |
| @@ -503,7 +500,6 @@ static void poll_idle(void) | |||
| 503 | * | 500 | * |
| 504 | * idle=mwait overrides this decision and forces the usage of mwait. | 501 | * idle=mwait overrides this decision and forces the usage of mwait. |
| 505 | */ | 502 | */ |
| 506 | static int __cpuinitdata force_mwait; | ||
| 507 | 503 | ||
| 508 | #define MWAIT_INFO 0x05 | 504 | #define MWAIT_INFO 0x05 |
| 509 | #define MWAIT_ECX_EXTENDED_INFO 0x01 | 505 | #define MWAIT_ECX_EXTENDED_INFO 0x01 |
| @@ -513,7 +509,7 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) | |||
| 513 | { | 509 | { |
| 514 | u32 eax, ebx, ecx, edx; | 510 | u32 eax, ebx, ecx, edx; |
| 515 | 511 | ||
| 516 | if (force_mwait) | 512 | if (boot_option_idle_override == IDLE_FORCE_MWAIT) |
| 517 | return 1; | 513 | return 1; |
| 518 | 514 | ||
| 519 | if (c->cpuid_level < MWAIT_INFO) | 515 | if (c->cpuid_level < MWAIT_INFO) |
| @@ -633,9 +629,10 @@ static int __init idle_setup(char *str) | |||
| 633 | if (!strcmp(str, "poll")) { | 629 | if (!strcmp(str, "poll")) { |
| 634 | printk("using polling idle threads.\n"); | 630 | printk("using polling idle threads.\n"); |
| 635 | pm_idle = poll_idle; | 631 | pm_idle = poll_idle; |
| 636 | } else if (!strcmp(str, "mwait")) | 632 | boot_option_idle_override = IDLE_POLL; |
| 637 | force_mwait = 1; | 633 | } else if (!strcmp(str, "mwait")) { |
| 638 | else if (!strcmp(str, "halt")) { | 634 | boot_option_idle_override = IDLE_FORCE_MWAIT; |
| 635 | } else if (!strcmp(str, "halt")) { | ||
| 639 | /* | 636 | /* |
| 640 | * When the boot option of idle=halt is added, halt is | 637 | * When the boot option of idle=halt is added, halt is |
| 641 | * forced to be used for CPU idle. In such case CPU C2/C3 | 638 | * forced to be used for CPU idle. In such case CPU C2/C3 |
| @@ -644,8 +641,7 @@ static int __init idle_setup(char *str) | |||
| 644 | * the boot_option_idle_override. | 641 | * the boot_option_idle_override. |
| 645 | */ | 642 | */ |
| 646 | pm_idle = default_idle; | 643 | pm_idle = default_idle; |
| 647 | idle_halt = 1; | 644 | boot_option_idle_override = IDLE_HALT; |
| 648 | return 0; | ||
| 649 | } else if (!strcmp(str, "nomwait")) { | 645 | } else if (!strcmp(str, "nomwait")) { |
| 650 | /* | 646 | /* |
| 651 | * If the boot option of "idle=nomwait" is added, | 647 | * If the boot option of "idle=nomwait" is added, |
| @@ -653,12 +649,10 @@ static int __init idle_setup(char *str) | |||
| 653 | * states. In such case it won't touch the variable | 649 | * states. In such case it won't touch the variable |
| 654 | * of boot_option_idle_override. | 650 | * of boot_option_idle_override. |
| 655 | */ | 651 | */ |
| 656 | idle_nomwait = 1; | 652 | boot_option_idle_override = IDLE_NOMWAIT; |
| 657 | return 0; | ||
| 658 | } else | 653 | } else |
| 659 | return -1; | 654 | return -1; |
| 660 | 655 | ||
| 661 | boot_option_idle_override = 1; | ||
| 662 | return 0; | 656 | return 0; |
| 663 | } | 657 | } |
| 664 | early_param("idle", idle_setup); | 658 | early_param("idle", idle_setup); |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 4b9befa0e347..8d128783af47 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
| @@ -57,8 +57,6 @@ | |||
| 57 | #include <asm/syscalls.h> | 57 | #include <asm/syscalls.h> |
| 58 | #include <asm/debugreg.h> | 58 | #include <asm/debugreg.h> |
| 59 | 59 | ||
| 60 | #include <trace/events/power.h> | ||
| 61 | |||
| 62 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 60 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
| 63 | 61 | ||
| 64 | /* | 62 | /* |
| @@ -113,8 +111,6 @@ void cpu_idle(void) | |||
| 113 | stop_critical_timings(); | 111 | stop_critical_timings(); |
| 114 | pm_idle(); | 112 | pm_idle(); |
| 115 | start_critical_timings(); | 113 | start_critical_timings(); |
| 116 | trace_power_end(smp_processor_id()); | ||
| 117 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); | ||
| 118 | } | 114 | } |
| 119 | tick_nohz_restart_sched_tick(); | 115 | tick_nohz_restart_sched_tick(); |
| 120 | preempt_enable_no_resched(); | 116 | preempt_enable_no_resched(); |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 4c818a738396..bd387e8f73b4 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
| @@ -51,8 +51,6 @@ | |||
| 51 | #include <asm/syscalls.h> | 51 | #include <asm/syscalls.h> |
| 52 | #include <asm/debugreg.h> | 52 | #include <asm/debugreg.h> |
| 53 | 53 | ||
| 54 | #include <trace/events/power.h> | ||
| 55 | |||
| 56 | asmlinkage extern void ret_from_fork(void); | 54 | asmlinkage extern void ret_from_fork(void); |
| 57 | 55 | ||
| 58 | DEFINE_PER_CPU(unsigned long, old_rsp); | 56 | DEFINE_PER_CPU(unsigned long, old_rsp); |
| @@ -141,10 +139,6 @@ void cpu_idle(void) | |||
| 141 | pm_idle(); | 139 | pm_idle(); |
| 142 | start_critical_timings(); | 140 | start_critical_timings(); |
| 143 | 141 | ||
| 144 | trace_power_end(smp_processor_id()); | ||
| 145 | trace_cpu_idle(PWR_EVENT_EXIT, | ||
| 146 | smp_processor_id()); | ||
| 147 | |||
| 148 | /* In many cases the interrupt that ended idle | 142 | /* In many cases the interrupt that ended idle |
| 149 | has already called exit_idle. But some idle | 143 | has already called exit_idle. But some idle |
| 150 | loops can be woken up without interrupt. */ | 144 | loops can be woken up without interrupt. */ |
