linux-xiaomi-chiron/kernel/rcu
Paul E. McKenney 3f95aa81d2 rcu: Make TASKS_RCU handle tasks that are almost done exiting
Once a task has passed exit_notify() in the do_exit() code path, it
is no longer on the task lists, and is therefore no longer visible
to rcu_tasks_kthread().  This means that an almost-exited task might
be preempted while within a trampoline, and this task won't be waited
on by rcu_tasks_kthread().  This commit fixes this bug by adding an
srcu_struct.  An exiting task does srcu_read_lock() just before calling
exit_notify(), and does the corresponding srcu_read_unlock() after
doing the final preempt_disable().  This means that rcu_tasks_kthread()
can do synchronize_srcu() to wait for all mostly-exited tasks to reach
their final preempt_disable() region, and then use synchronize_sched()
to wait for those tasks to finish exiting.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-09-07 16:27:22 -07:00
..
Makefile rcutorture: Abstract rcu_torture_random() 2014-02-23 09:00:58 -08:00
rcu.h rcu: Fix __rcu_reclaim() to use true/false for bool 2014-07-09 09:15:32 -07:00
rcutorture.c rcu: Provide cond_resched_rcu_qs() to force quiescent states in long loops 2014-09-07 16:27:20 -07:00
srcu.c rcu: Eliminate read-modify-write ACCESS_ONCE() calls 2014-07-09 09:14:49 -07:00
tiny.c rcu: Add call_rcu_tasks() 2014-09-07 16:27:19 -07:00
tiny_plugin.h rcu: Protect uses of ->jiffies_stall with ACCESS_ONCE() 2014-04-29 08:44:41 -07:00
tree.c rcu: Provide cond_resched_rcu_qs() to force quiescent states in long loops 2014-09-07 16:27:20 -07:00
tree.h rcu: Make nocb leader kthreads process pending callbacks after spawning 2014-08-28 05:59:59 -07:00
tree_plugin.h rcu: Provide cond_resched_rcu_qs() to force quiescent states in long loops 2014-09-07 16:27:20 -07:00
tree_trace.c rcu: Stop tracking FSF's postal address 2014-02-17 15:01:37 -08:00
update.c rcu: Make TASKS_RCU handle tasks that are almost done exiting 2014-09-07 16:27:22 -07:00