Re: [PATCH] Remove RCU abuse in cpu_idle()

From: Nish Aravamudan
Date: Sat Dec 18 2004 - 21:42:33 EST


On Sat, 11 Dec 2004 22:49:28 -0700 (MST), Zwane Mwaikambo
<zwane@xxxxxxxxxxxxxxxx> wrote:
> On Sat, 11 Dec 2004, Zwane Mwaikambo wrote:
>
> > > Introduce cpu_idle_wait() on architectures requiring modification of
> > > pm_idle from modules, this will ensure that all processors have updated
> > > their cached values of pm_idle upon exit. This patch is to address the bug
> > > report at http://bugme.osdl.org/show_bug.cgi?id=1716 and replaces the
> > > current code fix which is in violation of normal RCU usage as pointed out
> > > by Stephen, Dipankar and Paul.

<snip>

> + wmb();
> + do {
> + schedule_timeout(HZ);
> + cpus_and(map, cpu_idle_map, cpu_online_map);
> + } while (!cpus_empty(map));

<snip>

All of these schedule_timeout() calls are broken. They do not set the
state before hand and therefore will return early. Since you're not
checking for signals and there are no waitqueue events around the
code, I'm assuming you can just use ssleep(1) instead of the current
schedule_timeout() calls.

Thanks,
Nish
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/