* [PATCH] aer: add cond_resched to aer_isr
@ 2015-07-23 21:54 Spencer Baugh
2015-08-03 22:44 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Spencer Baugh @ 2015-07-23 21:54 UTC (permalink / raw)
To: Bjorn Helgaas, Yijing Wang, Joern Engel, open list:PCI SUBSYSTEM,
open list
Cc: Joern Engel, Spencer Baugh, Spencer Baugh
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] aer: add cond_resched to aer_isr
2015-07-23 21:54 [PATCH] aer: add cond_resched to aer_isr Spencer Baugh
@ 2015-08-03 22:44 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2015-08-03 22:44 UTC (permalink / raw)
To: Spencer Baugh
Cc: Yijing Wang, Joern Engel, open list:PCI SUBSYSTEM, open list,
Joern Engel, Spencer Baugh
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-03 22:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 21:54 [PATCH] aer: add cond_resched to aer_isr Spencer Baugh
2015-08-03 22:44 ` Bjorn Helgaas
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).