Messages in this thread Patch in this message | | | From | Lai Jiangshan <> | Subject | [PATCH 4/8] rcu: delay task rcu state cleanup in exit_rcu() | Date | Wed, 7 Aug 2013 18:25:00 +0800 |
| |
exit_rcu() tries to clean up the task rcu state when the task is exiting. It did it by calls __rcu_read_unlock().
Actually, calling rcu_read_unlock_special() is enough. This patch defer it to the rcu_preempt_note_context_switch() of the next schedule().
This patch prepares for the next patch which defers rcu_read_unlock_special() if irq is disabled when __rcu_read_unlock() is called. So __rcu_read_unlock() can't work here(it is irq-disabled here) if the next patch applied.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> --- kernel/rcutree_plugin.h | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 6b23b6f..fc8b36f 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -942,10 +942,13 @@ void exit_rcu(void) if (likely(list_empty(¤t->rcu_node_entry))) return; - t->rcu_read_lock_nesting = 1; - barrier(); - t->rcu_read_unlock_special = RCU_READ_UNLOCK_BLOCKED; - __rcu_read_unlock(); + WARN_ON_ONCE(!(t->rcu_read_unlock_special | RCU_READ_UNLOCK_BLOCKED)); + /* + * Task RCU state(rcu_node_entry) of this task will be cleanup by + * the next rcu_preempt_note_context_switch() of the next schedule() + * in the do_exit(). + */ + t->rcu_read_lock_nesting = INT_MIN; } #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ -- 1.7.4.4
| |