lkml.org 
[lkml]   [2004]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: [RFC] Strange code in cpu_idle()
Hi Paul,

On Sat, 4 Dec 2004 16:45:57 -0800 "Paul E. McKenney" <paulmck@us.ibm.com> wrote:
>
> OK, I believe I found the other end of this:
>
> 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();
> }
>
> 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.
>
> There is probably a better way to do this, but that is what comes
> to mind immediately.
>
> Thoughts?

None, sorry :-)

I don't even remember that piece of code going in (I certainly didn't
write it), though I can see what it was trying to do.

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.057 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site