lkml.org 
[lkml]   [2008]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] i7300_idle driver v1.55
On Wed, Oct 22, 2008 at 12:19:22AM -0700, Andi Kleen wrote:
> Pallipadi, Venkatesh wrote:
> >
> > udelay may be more power efficient than polling.
>
> Isn't that function a one off anyways?

Which function is one off?

> >
> >> ;
> >>> +static void __exit i7300_idle_exit(void)
> >>> +{
> >>> + idle_notifier_unregister(&i7300_idle_nb);
> >> I still think this needs some kind of idle synchronization.
> >
> > This unregister uses atomic_notifier_chain_unregister() which
> > uses RCU and handles the race conditions that way.
>
> I didn't do a full analysis, but I didn't think RCU protects
> against the idle handler itself. At least not standard RCU.
> You would need to go through at least two quiescent periods,
> not one as standard code.
>
> There used to be an older
> idle synchronization interface for this case (which was removed
> at some point), perhaps it needs to be readded.
>
> Or just use stop_machine(). That protects against idle too
> and while it's a big hammer for unloading it should be ok.
>

stop_machine() for unregistering idle callback will deadlock due to RCU.

I am not sure why we need two cycles. RCU in the unregister makes
sure that no CPU is executing the callback handler and only then unregister
returns. So, that will mean no one can be in the callback rountine and we are
safe to remove the module. Correct?

Thanks,
Venki



\
 
 \ /
  Last update: 2008-10-23 01:43    [W:0.865 / U:5.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site