lkml.org 
[lkml]   [2010]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: while_each_thread() under rcu_read_lock() is broken?
On 06/24, Paul E. McKenney wrote:
>
> On Thu, Jun 24, 2010 at 11:57:02PM +0200, Oleg Nesterov wrote:
> > On 06/24, Paul E. McKenney wrote:
> > >
> > > 4. Some other thread might do pthread_exit(), removing itself
> > > from the thread group, and again might do so while the hapless
> > > reader is referencing that thread. In this case, we want
> > > the hapless reader to continue scanning the remainder of the
> > > thread group.
> >
> > Yes.
> >
> > But, if that thread was used as a starting point g, then
> >
> > before the patch: loop forever
> > after the patch: break
>
> So it is OK to skip some of the other threads in this case, even
> though they were present throughout the whole procedure?

I think, yes. We can miss them in any case, they can go away before
while_each_thread(g, t) starts the scan.

If g == group_leader (old or new), then we should notice this thread
at least.

Otherwise we can miss them all, with or without next_thread_careful().

Oleg.



\
 
 \ /
  Last update: 2010-06-25 12:01    [W:0.152 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site