Commit 677517771b7b6efaf8617e70f655b16f3cafcc9b
Committed by
Linus Torvalds
1 parent
e2688f00dc
Exists in
master
and in
7 other branches
[PATCH] rcu: uninline __rcu_pending()
__rcu_pending() is rather fat and called twice from rcu_pending(). rcu_pending() has multiple callers, and not that small too. This patch uninlines both of them. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Paul E. McKenney <paulmck@us.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 2 changed files with 31 additions and 30 deletions Side-by-side Diff
include/linux/rcupdate.h
... | ... | @@ -125,36 +125,7 @@ |
125 | 125 | rdp->passed_quiesc = 1; |
126 | 126 | } |
127 | 127 | |
128 | -static inline int __rcu_pending(struct rcu_ctrlblk *rcp, | |
129 | - struct rcu_data *rdp) | |
130 | -{ | |
131 | - /* This cpu has pending rcu entries and the grace period | |
132 | - * for them has completed. | |
133 | - */ | |
134 | - if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch)) | |
135 | - return 1; | |
136 | - | |
137 | - /* This cpu has no pending entries, but there are new entries */ | |
138 | - if (!rdp->curlist && rdp->nxtlist) | |
139 | - return 1; | |
140 | - | |
141 | - /* This cpu has finished callbacks to invoke */ | |
142 | - if (rdp->donelist) | |
143 | - return 1; | |
144 | - | |
145 | - /* The rcu core waits for a quiescent state from the cpu */ | |
146 | - if (rdp->quiescbatch != rcp->cur || rdp->qs_pending) | |
147 | - return 1; | |
148 | - | |
149 | - /* nothing to do */ | |
150 | - return 0; | |
151 | -} | |
152 | - | |
153 | -static inline int rcu_pending(int cpu) | |
154 | -{ | |
155 | - return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || | |
156 | - __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); | |
157 | -} | |
128 | +extern int rcu_pending(int cpu); | |
158 | 129 | |
159 | 130 | /** |
160 | 131 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
kernel/rcupdate.c
... | ... | @@ -429,6 +429,36 @@ |
429 | 429 | &__get_cpu_var(rcu_bh_data)); |
430 | 430 | } |
431 | 431 | |
432 | +static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp) | |
433 | +{ | |
434 | + /* This cpu has pending rcu entries and the grace period | |
435 | + * for them has completed. | |
436 | + */ | |
437 | + if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch)) | |
438 | + return 1; | |
439 | + | |
440 | + /* This cpu has no pending entries, but there are new entries */ | |
441 | + if (!rdp->curlist && rdp->nxtlist) | |
442 | + return 1; | |
443 | + | |
444 | + /* This cpu has finished callbacks to invoke */ | |
445 | + if (rdp->donelist) | |
446 | + return 1; | |
447 | + | |
448 | + /* The rcu core waits for a quiescent state from the cpu */ | |
449 | + if (rdp->quiescbatch != rcp->cur || rdp->qs_pending) | |
450 | + return 1; | |
451 | + | |
452 | + /* nothing to do */ | |
453 | + return 0; | |
454 | +} | |
455 | + | |
456 | +int rcu_pending(int cpu) | |
457 | +{ | |
458 | + return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || | |
459 | + __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); | |
460 | +} | |
461 | + | |
432 | 462 | void rcu_check_callbacks(int cpu, int user) |
433 | 463 | { |
434 | 464 | if (user || |