|
Lines 153-161
EXPORT_SYMBOL_GPL(cpu_idle_wait);
Link Here
|
| 153 |
* New with Core Duo processors, MWAIT can take some hints based on CPU |
153 |
* New with Core Duo processors, MWAIT can take some hints based on CPU |
| 154 |
* capability. |
154 |
* capability. |
| 155 |
*/ |
155 |
*/ |
|
|
156 |
static int do_clflush; |
| 157 |
|
| 156 |
void mwait_idle_with_hints(unsigned long ax, unsigned long cx) |
158 |
void mwait_idle_with_hints(unsigned long ax, unsigned long cx) |
| 157 |
{ |
159 |
{ |
| 158 |
if (!need_resched()) { |
160 |
if (!need_resched()) { |
|
|
161 |
if (do_clflush) |
| 162 |
clflush((void *)¤t_thread_info()->flags); |
| 163 |
|
| 159 |
__monitor((void *)¤t_thread_info()->flags, 0, 0); |
164 |
__monitor((void *)¤t_thread_info()->flags, 0, 0); |
| 160 |
smp_mb(); |
165 |
smp_mb(); |
| 161 |
if (!need_resched()) |
166 |
if (!need_resched()) |
|
Lines 167-172
void mwait_idle_with_hints(unsigned long
Link Here
|
| 167 |
static void mwait_idle(void) |
172 |
static void mwait_idle(void) |
| 168 |
{ |
173 |
{ |
| 169 |
if (!need_resched()) { |
174 |
if (!need_resched()) { |
|
|
175 |
if (do_clflush) |
| 176 |
clflush((void *)¤t_thread_info()->flags); |
| 177 |
|
| 170 |
__monitor((void *)¤t_thread_info()->flags, 0, 0); |
178 |
__monitor((void *)¤t_thread_info()->flags, 0, 0); |
| 171 |
smp_mb(); |
179 |
smp_mb(); |
| 172 |
if (!need_resched()) |
180 |
if (!need_resched()) |
|
Lines 341-346
static int __init idle_setup(char *str)
Link Here
|
| 341 |
if (!strcmp(str, "poll")) { |
349 |
if (!strcmp(str, "poll")) { |
| 342 |
printk("using polling idle threads.\n"); |
350 |
printk("using polling idle threads.\n"); |
| 343 |
pm_idle = poll_idle; |
351 |
pm_idle = poll_idle; |
|
|
352 |
} else if (!strcmp(str, "clflush")) { |
| 353 |
do_clflush = 1; |
| 354 |
printk("Enabling CLFLUSH on MWAIT\n"); |
| 344 |
} else if (!strcmp(str, "mwait")) |
355 |
} else if (!strcmp(str, "mwait")) |
| 345 |
force_mwait = 1; |
356 |
force_mwait = 1; |
| 346 |
else if (!strcmp(str, "halt")) { |
357 |
else if (!strcmp(str, "halt")) { |