diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2011-01-12 17:10:23 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-06 02:16:54 -0400 |
commit | a26ac2455ffcf3be5c6ef92bc6df7182700f2114 (patch) | |
tree | 601697c7c3fd152a1b3f29f43d3a028fc8fefd5f /kernel/rcutree.h | |
parent | 12f5f524cafef3ab689929b118f2dfb8bf2be321 (diff) |
rcu: move TREE_RCU from softirq to kthread
If RCU priority boosting is to be meaningful, callback invocation must
be boosted in addition to preempted RCU readers. Otherwise, in presence
of CPU real-time threads, the grace period ends, but the callbacks don't
get invoked. If the callbacks don't get invoked, the associated memory
doesn't get freed, so the system is still subject to OOM.
But it is not reasonable to priority-boost RCU_SOFTIRQ, so this commit
moves the callback invocations to a kthread, which can be boosted easily.
Also add comments and properly synchronized all accesses to
rcu_cpu_kthread_task, as suggested by Lai Jiangshan.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r-- | kernel/rcutree.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 5a439c180e69..c0213802d164 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -111,6 +111,7 @@ struct rcu_node { | |||
111 | /* elements that need to drain to allow the */ | 111 | /* elements that need to drain to allow the */ |
112 | /* current expedited grace period to */ | 112 | /* current expedited grace period to */ |
113 | /* complete (only for TREE_PREEMPT_RCU). */ | 113 | /* complete (only for TREE_PREEMPT_RCU). */ |
114 | unsigned long wakemask; /* CPUs whose kthread needs to be awakened. */ | ||
114 | unsigned long qsmaskinit; | 115 | unsigned long qsmaskinit; |
115 | /* Per-GP initial value for qsmask & expmask. */ | 116 | /* Per-GP initial value for qsmask & expmask. */ |
116 | unsigned long grpmask; /* Mask to apply to parent qsmask. */ | 117 | unsigned long grpmask; /* Mask to apply to parent qsmask. */ |
@@ -134,6 +135,13 @@ struct rcu_node { | |||
134 | /* if there is no such task. If there */ | 135 | /* if there is no such task. If there */ |
135 | /* is no current expedited grace period, */ | 136 | /* is no current expedited grace period, */ |
136 | /* then there can cannot be any such task. */ | 137 | /* then there can cannot be any such task. */ |
138 | struct task_struct *node_kthread_task; | ||
139 | /* kthread that takes care of this rcu_node */ | ||
140 | /* structure, for example, awakening the */ | ||
141 | /* per-CPU kthreads as needed. */ | ||
142 | wait_queue_head_t node_wq; | ||
143 | /* Wait queue on which to park the per-node */ | ||
144 | /* kthread. */ | ||
137 | } ____cacheline_internodealigned_in_smp; | 145 | } ____cacheline_internodealigned_in_smp; |
138 | 146 | ||
139 | /* | 147 | /* |