linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Spencer Baugh <sbaugh@catern.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Yijing Wang <wangyijing@huawei.com>,
	Joern Engel <joern@logfs.org>,
	linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM),
	linux-kernel@vger.kernel.org (open list)
Cc: Joern Engel <joern@purestorage.com>,
	Spencer Baugh <Spencer.baugh@purestorage.com>,
	Spencer Baugh <sbaugh@catern.com>
Subject: [PATCH] aer: add cond_resched to aer_isr
Date: Thu, 23 Jul 2015 14:54:32 -0700	[thread overview]
Message-ID: <1437688476-3399-2-git-send-email-sbaugh@catern.com> (raw)

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.

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-07-23 21:54 UTC|newest]

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

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=1437688476-3399-2-git-send-email-sbaugh@catern.com \
    --to=sbaugh@catern.com \
    --cc=Spencer.baugh@purestorage.com \
    --cc=bhelgaas@google.com \
    --cc=joern@logfs.org \
    --cc=joern@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).