From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757763AbdDRRnK (ORCPT ); Tue, 18 Apr 2017 13:43:10 -0400 Received: from foss.arm.com ([217.140.101.70]:59344 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753802AbdDRRnH (ORCPT ); Tue, 18 Apr 2017 13:43:07 -0400 Subject: Re: [PATCH RFC srcu] Expedite srcu_schedule_cbs_snp() callback invocation To: paulmck@linux.vnet.ibm.com References: <20170418173347.GA9240@linux.vnet.ibm.com> Cc: linux-kernel@vger.kernel.org From: Marc Zyngier Organization: ARM Ltd Message-ID: <5b683054-084a-fae7-0bc6-8db28f0860c3@arm.com> Date: Tue, 18 Apr 2017 18:43:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170418173347.GA9240@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/04/17 18:33, Paul E. McKenney wrote: > 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 > Signed-off-by: Paul E. McKenney > > 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); > } > > /* This fixes the issue I was observing, where UEFI in a KVM guest would take a x8 slowdown while it messes with some NOR flash emulation on arm64 (don't ask, this is horrible...). Anyway: Tested-by: Marc Zyngier Thanks again Paul! M. -- Jazz is not dead. It just smells funny...