lkml.org 
[lkml]   [2008]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC 3/3] x86: use mwait for trigger API
Date
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.


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