mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
srcu: Compute snp_seq earlier in srcu_funnel_gp_start()
Currently, srcu_funnel_gp_start() tests snp->srcu_have_cbs[idx] and then separately assigns it to the snp_seq local variable. This commit does the assignment earlier to simplify the code a bit. While in the area, this commit also takes advantage of the 100-character line limit to put the call to srcu_schedule_cbs_sdp() on a single line. Co-developed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com> Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
3bedebcf63
commit
aeb9b39b8f
1 changed files with 3 additions and 5 deletions
|
@ -697,15 +697,13 @@ static void srcu_funnel_gp_start(struct srcu_struct *ssp, struct srcu_data *sdp,
|
||||||
if (rcu_seq_done(&ssp->srcu_gp_seq, s) && snp != snp_leaf)
|
if (rcu_seq_done(&ssp->srcu_gp_seq, s) && snp != snp_leaf)
|
||||||
return; /* GP already done and CBs recorded. */
|
return; /* GP already done and CBs recorded. */
|
||||||
spin_lock_irqsave_rcu_node(snp, flags);
|
spin_lock_irqsave_rcu_node(snp, flags);
|
||||||
if (ULONG_CMP_GE(snp->srcu_have_cbs[idx], s)) {
|
snp_seq = snp->srcu_have_cbs[idx];
|
||||||
snp_seq = snp->srcu_have_cbs[idx];
|
if (ULONG_CMP_GE(snp_seq, s)) {
|
||||||
if (snp == snp_leaf && snp_seq == s)
|
if (snp == snp_leaf && snp_seq == s)
|
||||||
snp->srcu_data_have_cbs[idx] |= sdp->grpmask;
|
snp->srcu_data_have_cbs[idx] |= sdp->grpmask;
|
||||||
spin_unlock_irqrestore_rcu_node(snp, flags);
|
spin_unlock_irqrestore_rcu_node(snp, flags);
|
||||||
if (snp == snp_leaf && snp_seq != s) {
|
if (snp == snp_leaf && snp_seq != s) {
|
||||||
srcu_schedule_cbs_sdp(sdp, do_norm
|
srcu_schedule_cbs_sdp(sdp, do_norm ? SRCU_INTERVAL : 0);
|
||||||
? SRCU_INTERVAL
|
|
||||||
: 0);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!do_norm)
|
if (!do_norm)
|
||||||
|
|
Loading…
Reference in a new issue