lkml.org 
[lkml]   [2013]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] rcu: delay task rcu state cleanup in exit_rcu()
Date
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(&current->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


\
 
 \ /
  Last update: 2013-08-07 12:41    [W:2.665 / U:2.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site