From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
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 14:25:57 +0200 [thread overview]
Message-ID: <200808281425.57336.borntraeger@de.ibm.com> (raw)
In-Reply-To: <48A70192.7020002@goop.org>
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.
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);
> + }
> + }
> +}
> +
> +void mwait_trigger_finish(trigger_t *t)
> +{
> + local_irq_restore(__get_cpu_var(mwait_saved_flags));
> +}
> +
> +void mwait_trigger_kick(trigger_t *t)
> +{
> + cpus_setall(t->cpus);
We set the bits here.
> + smp_wmb();
> + t->trigger = 1;
> + smp_wmb();
> +}
Nothing else.
next prev parent reply other threads:[~2008-08-28 12:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-16 16:34 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 [this message]
2008-08-28 17:33 ` Jeremy Fitzhardinge
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=200808281425.57336.borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=arjan@infradead.org \
--cc=jens.axboe@oracle.com \
--cc=jeremy@goop.org \
--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
all inboxes | Powered by JetHome®