[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <48B6E174.7070308@goop.org>
Date: Thu, 28 Aug 2008 10:33:40 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Christian Borntraeger <borntraeger@...ibm.com>
CC: Ingo Molnar <mingo@...e.hu>, Jens Axboe <jens.axboe@...cle.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Arjan van de Ven <arjan@...radead.org>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists