RE: [RFC] Strange code in cpu_idle()

From: Li, Shaohua
Date: Mon Dec 06 2004 - 04:15:56 EST


>static void __exit apm_exit(void)
>{
> int error;
>
> if (set_pm_idle) {
> pm_idle = original_pm_idle;
> /*
> * We are about to unload the current idle thread pm
callback
> * (pm_idle), Wait for all processors to update
cached/local
> * copies of pm_idle before proceeding.
> */
> synchronize_kernel();
> }
This patch is written by me. The detail information is in
http://bugzilla.kernel.org/show_bug.cgi?id=1716


>Unfortunately, the idle loop is a quiescent state, so it is
>possible for synchronize_kernel() to return before the idle threads
>have returned. So I don't believe RCU is useful here. One other
>approach would be to keep a cpu mask, in which apm_exit() sets all
>bits, and pm_idle() clears its CPU's bit only if it is set.
>Then apm_exit() could wait for all CPU's bits to clear.
This is my original idea. We think it's too complex, so we discard it.
Sorry for my bad.

Thanks,
Shaohua
-
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/