aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcupdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r--kernel/rcupdate.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 30b0bba03859..ccc45d49ce71 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -429,6 +429,36 @@ static void rcu_process_callbacks(unsigned long unused)
429 &__get_cpu_var(rcu_bh_data)); 429 &__get_cpu_var(rcu_bh_data));
430} 430}
431 431
432static 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
456int 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
432void rcu_check_callbacks(int cpu, int user) 462void rcu_check_callbacks(int cpu, int user)
433{ 463{
434 if (user || 464 if (user ||