Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755919AbbHCWo0 (ORCPT ); Mon, 3 Aug 2015 18:44:26 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:34426 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755903AbbHCWoX (ORCPT ); Mon, 3 Aug 2015 18:44:23 -0400 Date: Mon, 3 Aug 2015 17:44:18 -0500 From: Bjorn Helgaas To: Spencer Baugh Cc: Yijing Wang , Joern Engel , "open list:PCI SUBSYSTEM" , open list , Joern Engel , Spencer Baugh Subject: Re: [PATCH] aer: add cond_resched to aer_isr Message-ID: <20150803224418.GC11144@google.com> References: <1437688476-3399-2-git-send-email-sbaugh@catern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437688476-3399-2-git-send-email-sbaugh@catern.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1598 Lines: 44 Hi Spencer & Joern, On Thu, Jul 23, 2015 at 02:54:32PM -0700, Spencer Baugh wrote: > From: Joern Engel > > Multiple nested loops. I have observed 590ms scheduler latency caused > by this loop and interrupts. Interrupts were responsible for 190ms, the > rest could have been avoided with a cond_resched. I'm not disagreeing with this patch, but it would be helpful to sketch the outline of the "multiple nested loop" problem here. This might be a hint that we could do even better by rethinking the algorithm reduce the nesting. > Signed-off-by: Joern Engel > Signed-off-by: Spencer Baugh > --- > drivers/pci/pcie/aer/aerdrv_core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c > index 9803e3d..32b1b5c 100644 > --- a/drivers/pci/pcie/aer/aerdrv_core.c > +++ b/drivers/pci/pcie/aer/aerdrv_core.c > @@ -780,8 +780,10 @@ void aer_isr(struct work_struct *work) > struct aer_err_source uninitialized_var(e_src); > > mutex_lock(&rpc->rpc_mutex); > - while (get_e_source(rpc, &e_src)) > + while (get_e_source(rpc, &e_src)) { > aer_isr_one_error(p_device, &e_src); > + cond_resched(); > + } > mutex_unlock(&rpc->rpc_mutex); > > wake_up(&rpc->wait_release); > -- > 2.5.0.rc3 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/