lkml.org 
[lkml]   [2008]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 3/3] x86: use mwait for trigger API
Christian Borntraeger wrote:
> Am Samstag, 16. August 2008 schrieb Jeremy Fitzhardinge:
>
> Seems that this cant work. We never reset the t->cpus bits. That means we
> never mwait after a kick.
>

Yeah, I have to admit I never tested this code (it was an RFC, after
all). And after Arjan said that mwait is unusable, I didn't spend any
more effort on it.

> See:
>
>
>> +void mwait_trigger_reset(trigger_t *t)
>> +{
>> + unsigned long flags;
>> +
>> + t->trigger = 0;
>> +
>> + local_save_flags(flags);
>> + __get_cpu_var(mwait_saved_flags) = flags;
>> +
>> + __monitor(&t->trigger, 0, 0);
>> +}
>> +
>> +void mwait_trigger_wait(trigger_t *t)
>> +{
>> + unsigned long flags = __get_cpu_var(mwait_saved_flags);
>> + int cpu = smp_processor_id();
>> +
>> + if (irqs_disabled_flags(flags)) {
>> + while(!cpu_isset(cpu, t->cpus)) {
>>
>
> We check the bits here
>
>
>> + __mwait(0, 0);
>> + barrier();
>> + __monitor(&t->trigger, 0, 0);
>> + }
>> + } else {
>> + while(!cpu_isset(cpu, t->cpus)) {
>>
>
> and here
>
>
>> + __sti_mwait(0, 0);
>> + barrier();
>> + local_irq_disable();
>> + __monitor(&t->trigger, 0, 0);
>> + }
>> + }
>>

Must have lost a line somewhere. It's supposed to clear the bit here,
before wait returns.

J


\
 
 \ /
  Last update: 2008-08-28 19:37    [W:0.091 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site