OSDN Git Service

rcu: Make synchronize_sched_expedited() call wait_rcu_gp()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 1 May 2015 20:01:38 +0000 (13:01 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 27 May 2015 19:58:03 +0000 (12:58 -0700)
commit30ff1533b8f75255bdf02bc3361f1c558138f471
tree7785fb47d3d21d1d61efa583a4d05eaa9e1a40bb
parent5af4692a75daf08dddc93dbb4cd2a1b3d3b617af
rcu: Make synchronize_sched_expedited() call wait_rcu_gp()

Currently, synchronize_sched_expedited() will call synchronize_sched()
if there is danger of counter wrap.  But if configuration says to
always do expedited grace periods, synchronize_sched() will just
call synchronize_sched_expedited() right back again.  In theory,
the old expedited operations will complete, the counters will
get back in synch, and the recursion will end.  But we could
easily run out of stack long before that time.  This commit
therefore makes synchronize_sched_expedited() invoke the underlying
wait_rcu_gp(call_rcu_sched) instead of synchronize_sched(), the same as
all the other calls out from synchronize_sched_expedited().

This bug was introduced by commit 1924bcb02597 (Avoid counter wrap in
synchronize_sched_expedited()).

Reported-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c