mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
rcu: Add comment headers to expedited-grace-period counter functions
These functions (rcu_exp_gp_seq_start(), rcu_exp_gp_seq_end(), rcu_exp_gp_seq_snap(), and rcu_exp_gp_seq_done() seemed too obvious to comment when written, but not so much when being documented. This commit therefore adds header comments to each of them. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
parent
630c7ed9ca
commit
09e2db37ec
1 changed files with 17 additions and 1 deletions
|
@ -20,16 +20,26 @@
|
||||||
* Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
|
* Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Wrapper functions for expedited grace periods. */
|
/*
|
||||||
|
* Record the start of an expedited grace period.
|
||||||
|
*/
|
||||||
static void rcu_exp_gp_seq_start(struct rcu_state *rsp)
|
static void rcu_exp_gp_seq_start(struct rcu_state *rsp)
|
||||||
{
|
{
|
||||||
rcu_seq_start(&rsp->expedited_sequence);
|
rcu_seq_start(&rsp->expedited_sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Record the end of an expedited grace period.
|
||||||
|
*/
|
||||||
static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
|
static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
|
||||||
{
|
{
|
||||||
rcu_seq_end(&rsp->expedited_sequence);
|
rcu_seq_end(&rsp->expedited_sequence);
|
||||||
smp_mb(); /* Ensure that consecutive grace periods serialize. */
|
smp_mb(); /* Ensure that consecutive grace periods serialize. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Take a snapshot of the expedited-grace-period counter.
|
||||||
|
*/
|
||||||
static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
|
static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
|
||||||
{
|
{
|
||||||
unsigned long s;
|
unsigned long s;
|
||||||
|
@ -39,6 +49,12 @@ static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
|
||||||
trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
|
trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Given a counter snapshot from rcu_exp_gp_seq_snap(), return true
|
||||||
|
* if a full expedited grace period has elapsed since that snapshot
|
||||||
|
* was taken.
|
||||||
|
*/
|
||||||
static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
|
static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
|
||||||
{
|
{
|
||||||
return rcu_seq_done(&rsp->expedited_sequence, s);
|
return rcu_seq_done(&rsp->expedited_sequence, s);
|
||||||
|
|
Loading…
Add table
Reference in a new issue