On 27/07/2015 12:44, Wen Congyang wrote:
> >          * rcu_register_thread() may add nodes to &registry; it will not
> >          * wake up synchronize_rcu, but that is okay because at least 
> > another
> >          * thread must exit its RCU read-side critical section before
> >          * synchronize_rcu is done.  The next iteration of the loop will
> >          * process the new thread or set ->waiting for it.  Hence, this can
> >          * at worst cause synchronize_rcu() to wait for longer.
> I don't understand this. The next iteration of the loop will move the new 
> thread's
> rcu_reader from registry to qsreaders even if we call rcu_read_lock() in the 
> new thread.
> Because rcu_gp_ongoing() will return false.

You're right.  This proves that a comment was necessary! :)

Second try:

     * rcu_register_thread() may add nodes to &registry; it will not
     * wake up synchronize_rcu, but that is okay because at least another
     * thread must exit its RCU read-side critical section before
     * synchronize_rcu is done.  The next iteration of the loop will
     * move the new thread's rcu_reader from &registry to &qsreaders,
     * because rcu_gp_ongoing() will return false.

Paolo

Reply via email to