Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625494

[PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback invocation

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback invocation
Date 2017-04-18 19:40 +0200
Message-ID <txFgC-un-21@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Although Tree SRCU does reduce delays when there is at least one
synchronize_srcu_expedited() invocation pending, srcu_schedule_cbs_snp()
still waits for SRCU_INTERVAL before invoking callbacks.  Since
synchronize_srcu_expedited() now posts a callback and waits for
that callback to do a wakeup, this destroys the expedited nature of
synchronize_srcu_expedited().

This commit therefore invokes callbacks immediately at the end of the
grace period when there is at least one synchronize_srcu_expedited()
invocation pending.

Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 1e54f91c2ff7..744ffdb79d23 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -447,7 +447,8 @@ static void srcu_schedule_cbs_snp(struct srcu_struct *sp, struct srcu_node *snp)
 	int cpu;
 
 	for (cpu = snp->grplo; cpu <= snp->grphi; cpu++)
-		srcu_schedule_cbs_sdp(per_cpu_ptr(sp->sda, cpu), SRCU_INTERVAL);
+		srcu_schedule_cbs_sdp(per_cpu_ptr(sp->sda, cpu),
+				      atomic_read(&sp->srcu_exp_cnt) ? 0 : SRCU_INTERVAL);
 }
 
 /*

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback invocation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-04-18 19:40 +0200
  Re: [PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback  invocation Marc Zyngier <marc.zyngier@arm.com> - 2017-04-18 19:50 +0200
    Re: [PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback  invocation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-04-18 20:00 +0200

csiph-web