public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, Jens Axboe <jens.axboe@oracle.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH RFC 3/3] x86: use mwait for trigger API
Date: Thu, 28 Aug 2008 10:33:40 -0700	[thread overview]
Message-ID: <48B6E174.7070308@goop.org> (raw)
In-Reply-To: <200808281425.57336.borntraeger@de.ibm.com>

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

      reply	other threads:[~2008-08-28 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 16:34 [PATCH RFC 3/3] x86: use mwait for trigger API Jeremy Fitzhardinge
2008-08-16 17:44 ` Arjan van de Ven
2008-08-16 21:50   ` Jeremy Fitzhardinge
2008-08-16 22:31     ` Arjan van de Ven
2008-08-28 12:25 ` Christian Borntraeger
2008-08-28 17:33   ` Jeremy Fitzhardinge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B6E174.7070308@goop.org \
    --to=jeremy@goop.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@infradead.org \
    --cc=borntraeger@de.ibm.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox