lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] generic dynamic per cpu refcounting
Hello, Kent.

On Mon, Jan 28, 2013 at 12:55:40PM -0800, Kent Overstreet wrote:
> > I don't understand why we need two stages. What prevents the killing
> > thread from fetching percpu counters after dying passes one
> > synchronize_sched()?
>
> It does. The second synchronize_sched() is needed after we set state :=
> dead, and before we drop the initial ref. Otherwise the ref could hit 0
> before percpu_ref_put knows to check for it.

Still a bit confused. Why do we need to make the two steps separate?
What prevents us from doing the following?

set dying;
synchronize_sched();
collect percpu refs into global atomic_t;
put the base ref;

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-01-28 23:01    [W:0.043 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site