All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Spencer Baugh <sbaugh@catern.com>
Cc: Yijing Wang <wangyijing@huawei.com>,
	Joern Engel <joern@logfs.org>,
	"open list:PCI SUBSYSTEM" <linux-pci@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Joern Engel <joern@purestorage.com>,
	Spencer Baugh <Spencer.baugh@purestorage.com>
Subject: Re: [PATCH] aer: add cond_resched to aer_isr
Date: Mon, 3 Aug 2015 17:44:18 -0500	[thread overview]
Message-ID: <20150803224418.GC11144@google.com> (raw)
In-Reply-To: <1437688476-3399-2-git-send-email-sbaugh@catern.com>

Hi Spencer & Joern,

On Thu, Jul 23, 2015 at 02:54:32PM -0700, Spencer Baugh wrote:
> From: Joern Engel <joern@logfs.org>
> 
> 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 <joern@logfs.org>
> Signed-off-by: Spencer Baugh <sbaugh@catern.com>
> ---
>  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
> 

      reply	other threads:[~2015-08-03 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 21:54 [PATCH] aer: add cond_resched to aer_isr Spencer Baugh
2015-08-03 22:44 ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150803224418.GC11144@google.com \
    --to=bhelgaas@google.com \
    --cc=Spencer.baugh@purestorage.com \
    --cc=joern@logfs.org \
    --cc=joern@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sbaugh@catern.com \
    --cc=wangyijing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.