diff options
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r-- | kernel/rcupdate.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 13458bbaa1be..2058f88c7bbb 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -479,12 +479,31 @@ static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp) | |||
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | 481 | ||
482 | /* | ||
483 | * Check to see if there is any immediate RCU-related work to be done | ||
484 | * by the current CPU, returning 1 if so. This function is part of the | ||
485 | * RCU implementation; it is -not- an exported member of the RCU API. | ||
486 | */ | ||
482 | int rcu_pending(int cpu) | 487 | int rcu_pending(int cpu) |
483 | { | 488 | { |
484 | return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || | 489 | return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || |
485 | __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); | 490 | __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); |
486 | } | 491 | } |
487 | 492 | ||
493 | /* | ||
494 | * Check to see if any future RCU-related work will need to be done | ||
495 | * by the current CPU, even if none need be done immediately, returning | ||
496 | * 1 if so. This function is part of the RCU implementation; it is -not- | ||
497 | * an exported member of the RCU API. | ||
498 | */ | ||
499 | int rcu_needs_cpu(int cpu) | ||
500 | { | ||
501 | struct rcu_data *rdp = &per_cpu(rcu_data, cpu); | ||
502 | struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu); | ||
503 | |||
504 | return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu)); | ||
505 | } | ||
506 | |||
488 | void rcu_check_callbacks(int cpu, int user) | 507 | void rcu_check_callbacks(int cpu, int user) |
489 | { | 508 | { |
490 | if (user || | 509 | if (user || |
@@ -520,7 +539,7 @@ static void __devinit rcu_online_cpu(int cpu) | |||
520 | tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); | 539 | tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); |
521 | } | 540 | } |
522 | 541 | ||
523 | static int __devinit rcu_cpu_notify(struct notifier_block *self, | 542 | static int rcu_cpu_notify(struct notifier_block *self, |
524 | unsigned long action, void *hcpu) | 543 | unsigned long action, void *hcpu) |
525 | { | 544 | { |
526 | long cpu = (long)hcpu; | 545 | long cpu = (long)hcpu; |
@@ -537,7 +556,7 @@ static int __devinit rcu_cpu_notify(struct notifier_block *self, | |||
537 | return NOTIFY_OK; | 556 | return NOTIFY_OK; |
538 | } | 557 | } |
539 | 558 | ||
540 | static struct notifier_block __devinitdata rcu_nb = { | 559 | static struct notifier_block rcu_nb = { |
541 | .notifier_call = rcu_cpu_notify, | 560 | .notifier_call = rcu_cpu_notify, |
542 | }; | 561 | }; |
543 | 562 | ||