Compile in the cpu halt code even on SMP, instead just default the
sysctl (machdep.cpu_idle_hlt) to off in the SMP case. This allows you to turn it on if you wish and do not particularly care about the small window where a cpu will remain halted even when a job is placed on the run queue (until the next clock tick).
This commit is contained in:
parent
ad5da01926
commit
ca21d675fc
@ -780,7 +780,11 @@ cpu_halt(void)
|
||||
* the !SMP case, as there is no clean way to ensure that a CPU will be
|
||||
* woken when there is work available for it.
|
||||
*/
|
||||
#ifdef SMP
|
||||
static int cpu_idle_hlt = 0;
|
||||
#else
|
||||
static int cpu_idle_hlt = 1;
|
||||
#endif
|
||||
SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW,
|
||||
&cpu_idle_hlt, 0, "Idle loop HLT enable");
|
||||
|
||||
@ -793,7 +797,6 @@ SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW,
|
||||
void
|
||||
cpu_idle(void)
|
||||
{
|
||||
#ifndef SMP
|
||||
if (cpu_idle_hlt) {
|
||||
disable_intr();
|
||||
if (procrunnable()) {
|
||||
@ -807,7 +810,6 @@ cpu_idle(void)
|
||||
__asm __volatile("sti; hlt");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -780,7 +780,11 @@ cpu_halt(void)
|
||||
* the !SMP case, as there is no clean way to ensure that a CPU will be
|
||||
* woken when there is work available for it.
|
||||
*/
|
||||
#ifdef SMP
|
||||
static int cpu_idle_hlt = 0;
|
||||
#else
|
||||
static int cpu_idle_hlt = 1;
|
||||
#endif
|
||||
SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW,
|
||||
&cpu_idle_hlt, 0, "Idle loop HLT enable");
|
||||
|
||||
@ -793,7 +797,6 @@ SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW,
|
||||
void
|
||||
cpu_idle(void)
|
||||
{
|
||||
#ifndef SMP
|
||||
if (cpu_idle_hlt) {
|
||||
disable_intr();
|
||||
if (procrunnable()) {
|
||||
@ -807,7 +810,6 @@ cpu_idle(void)
|
||||
__asm __volatile("sti; hlt");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user