diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-07-08 18:17:59 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-09-07 19:18:13 -0400 |
commit | 85b39d305bfe809a11ff2770d380be3e2465beec (patch) | |
tree | 2bc6f52c07779203329b0d791f631ab894a8846e /kernel | |
parent | e02b2edfa13878c6671d31d5c736f56f89d99bf1 (diff) |
rcu: Uninline rcu_read_lock_held()
This commit uninlines rcu_read_lock_held(). According to "size vmlinux"
this saves 28549 in .text:
- 5541731 3014560 14757888 23314179
+ 5513182 3026848 14757888 23297918
Note: it looks as if the data grows by 12288 bytes but this is not true,
it does not actually grow. But .data starts with ALIGN(THREAD_SIZE) and
since .text shrinks the padding grows, and thus .data grows too as it
seen by /bin/size. diff System.map:
- ffffffff81510000 D _sdata
- ffffffff81510000 D init_thread_union
+ ffffffff81509000 D _sdata
+ ffffffff8150c000 D init_thread_union
Perhaps we can change vmlinux.lds.S to .data itself, so that /bin/size
can't "wrongly" report that .data grows if .text shinks.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcu/update.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 4056d7992a6c..ea8ea7b16e11 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c | |||
@@ -137,6 +137,38 @@ int notrace debug_lockdep_rcu_enabled(void) | |||
137 | EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled); | 137 | EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled); |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * rcu_read_lock_held() - might we be in RCU read-side critical section? | ||
141 | * | ||
142 | * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU | ||
143 | * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC, | ||
144 | * this assumes we are in an RCU read-side critical section unless it can | ||
145 | * prove otherwise. This is useful for debug checks in functions that | ||
146 | * require that they be called within an RCU read-side critical section. | ||
147 | * | ||
148 | * Checks debug_lockdep_rcu_enabled() to prevent false positives during boot | ||
149 | * and while lockdep is disabled. | ||
150 | * | ||
151 | * Note that rcu_read_lock() and the matching rcu_read_unlock() must | ||
152 | * occur in the same context, for example, it is illegal to invoke | ||
153 | * rcu_read_unlock() in process context if the matching rcu_read_lock() | ||
154 | * was invoked from within an irq handler. | ||
155 | * | ||
156 | * Note that rcu_read_lock() is disallowed if the CPU is either idle or | ||
157 | * offline from an RCU perspective, so check for those as well. | ||
158 | */ | ||
159 | int rcu_read_lock_held(void) | ||
160 | { | ||
161 | if (!debug_lockdep_rcu_enabled()) | ||
162 | return 1; | ||
163 | if (!rcu_is_watching()) | ||
164 | return 0; | ||
165 | if (!rcu_lockdep_current_cpu_online()) | ||
166 | return 0; | ||
167 | return lock_is_held(&rcu_lock_map); | ||
168 | } | ||
169 | EXPORT_SYMBOL_GPL(rcu_read_lock_held); | ||
170 | |||
171 | /** | ||
140 | * rcu_read_lock_bh_held() - might we be in RCU-bh read-side critical section? | 172 | * rcu_read_lock_bh_held() - might we be in RCU-bh read-side critical section? |
141 | * | 173 | * |
142 | * Check for bottom half being disabled, which covers both the | 174 | * Check for bottom half being disabled, which covers both the |