diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-04-27 14:39:34 -0400 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-07-12 17:27:47 -0400 |
| commit | 17ef2fe97c8c8e754e4a702c42f8e5b0ffadf4dd (patch) | |
| tree | 57f08e5a676a2432fea98077ea5ff02626761e79 /kernel/rcu/tree.c | |
| parent | dee4f42298bba030e84035aca5c114f9fee8fa6a (diff) | |
rcu: Make rcutorture's batches-completed API use ->gp_seq
The rcutorture test invokes rcu_batches_started(),
rcu_batches_completed(), rcu_batches_started_bh(),
rcu_batches_completed_bh(), rcu_batches_started_sched(), and
rcu_batches_completed_sched() to do grace-period consistency checks,
and rcuperf uses the _completed variants for statistics.
These functions use ->gpnum and ->completed. This commit therefore
replaces them with rcu_get_gp_seq(), rcu_bh_get_gp_seq(), and
rcu_sched_get_gp_seq(), adjusting rcutorture and rcuperf to make
use of them.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
| -rw-r--r-- | kernel/rcu/tree.c | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 3c3af7e2758f..547112bec26a 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
| @@ -530,58 +530,31 @@ static void force_quiescent_state(struct rcu_state *rsp); | |||
| 530 | static int rcu_pending(void); | 530 | static int rcu_pending(void); |
| 531 | 531 | ||
| 532 | /* | 532 | /* |
| 533 | * Return the number of RCU batches started thus far for debug & stats. | 533 | * Return the number of RCU GPs completed thus far for debug & stats. |
| 534 | */ | 534 | */ |
| 535 | unsigned long rcu_batches_started(void) | 535 | unsigned long rcu_get_gp_seq(void) |
| 536 | { | 536 | { |
| 537 | return rcu_state_p->gpnum; | 537 | return rcu_seq_ctr(READ_ONCE(rcu_state_p->gp_seq)); |
| 538 | } | 538 | } |
| 539 | EXPORT_SYMBOL_GPL(rcu_batches_started); | 539 | EXPORT_SYMBOL_GPL(rcu_get_gp_seq); |
| 540 | 540 | ||
| 541 | /* | 541 | /* |
| 542 | * Return the number of RCU-sched batches started thus far for debug & stats. | 542 | * Return the number of RCU-sched GPs completed thus far for debug & stats. |
| 543 | */ | 543 | */ |
| 544 | unsigned long rcu_batches_started_sched(void) | 544 | unsigned long rcu_sched_get_gp_seq(void) |
| 545 | { | 545 | { |
| 546 | return rcu_sched_state.gpnum; | 546 | return rcu_seq_ctr(READ_ONCE(rcu_sched_state.gp_seq)); |
| 547 | } | 547 | } |
| 548 | EXPORT_SYMBOL_GPL(rcu_batches_started_sched); | 548 | EXPORT_SYMBOL_GPL(rcu_sched_get_gp_seq); |
| 549 | 549 | ||
| 550 | /* | 550 | /* |
| 551 | * Return the number of RCU BH batches started thus far for debug & stats. | 551 | * Return the number of RCU-bh GPs completed thus far for debug & stats. |
| 552 | */ | 552 | */ |
| 553 | unsigned long rcu_batches_started_bh(void) | 553 | unsigned long rcu_bh_get_gp_seq(void) |
| 554 | { | 554 | { |
| 555 | return rcu_bh_state.gpnum; | 555 | return rcu_seq_ctr(READ_ONCE(rcu_bh_state.gp_seq)); |
| 556 | } | 556 | } |
| 557 | EXPORT_SYMBOL_GPL(rcu_batches_started_bh); | 557 | EXPORT_SYMBOL_GPL(rcu_bh_get_gp_seq); |
| 558 | |||
| 559 | /* | ||
| 560 | * Return the number of RCU batches completed thus far for debug & stats. | ||
| 561 | */ | ||
| 562 | unsigned long rcu_batches_completed(void) | ||
| 563 | { | ||
| 564 | return rcu_state_p->completed; | ||
| 565 | } | ||
| 566 | EXPORT_SYMBOL_GPL(rcu_batches_completed); | ||
| 567 | |||
| 568 | /* | ||
| 569 | * Return the number of RCU-sched batches completed thus far for debug & stats. | ||
| 570 | */ | ||
| 571 | unsigned long rcu_batches_completed_sched(void) | ||
| 572 | { | ||
| 573 | return rcu_sched_state.completed; | ||
| 574 | } | ||
| 575 | EXPORT_SYMBOL_GPL(rcu_batches_completed_sched); | ||
| 576 | |||
| 577 | /* | ||
| 578 | * Return the number of RCU BH batches completed thus far for debug & stats. | ||
| 579 | */ | ||
| 580 | unsigned long rcu_batches_completed_bh(void) | ||
| 581 | { | ||
| 582 | return rcu_bh_state.completed; | ||
| 583 | } | ||
| 584 | EXPORT_SYMBOL_GPL(rcu_batches_completed_bh); | ||
| 585 | 558 | ||
| 586 | /* | 559 | /* |
| 587 | * Return the number of RCU expedited batches completed thus far for | 560 | * Return the number of RCU expedited batches completed thus far for |
