* [PATCH] rtas: Only sleep in rtas_busy_delay if we have useful work to do
@ 2011-04-07 11:54 Anton Blanchard
2011-04-07 18:11 ` Nishanth Aravamudan
0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2011-04-07 11:54 UTC (permalink / raw)
To: benh, paulus; +Cc: nacc, linuxppc-dev, miltonm
RTAS returns extended error codes as a hint of how long the
OS might want to wait before retrying a call. If we have nothing
else useful to do we may as well call back straight away.
This was found when testing the new dynamic dma window feature.
Firmware split the zeroing of the TCE table into 32k chunks but
returned 9901 (which is a suggested wait of 10ms). All up this took
about 10 minutes to complete since msleep is jiffies based and will
round 10ms up to 20ms.
With the patch below we take 3 seconds to complete the same test.
The hint firmware is returning in the RTAS call should definitely
be decreased, but even if we slept 1ms each iteration this would
take 32s.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-2.6/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas.c 2011-04-05 11:19:35.023234011 +1000
+++ linux-2.6/arch/powerpc/kernel/rtas.c 2011-04-07 21:25:24.646414629 +1000
@@ -494,7 +494,7 @@ unsigned int rtas_busy_delay(int status)
might_sleep();
ms = rtas_busy_delay_time(status);
- if (ms)
+ if (ms && need_resched())
msleep(ms);
return ms;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rtas: Only sleep in rtas_busy_delay if we have useful work to do
2011-04-07 11:54 [PATCH] rtas: Only sleep in rtas_busy_delay if we have useful work to do Anton Blanchard
@ 2011-04-07 18:11 ` Nishanth Aravamudan
0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2011-04-07 18:11 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev, miltonm
On 07.04.2011 [21:54:07 +1000], Anton Blanchard wrote:
>
> RTAS returns extended error codes as a hint of how long the
> OS might want to wait before retrying a call. If we have nothing
> else useful to do we may as well call back straight away.
>
> This was found when testing the new dynamic dma window feature.
> Firmware split the zeroing of the TCE table into 32k chunks but
> returned 9901 (which is a suggested wait of 10ms). All up this took
> about 10 minutes to complete since msleep is jiffies based and will
> round 10ms up to 20ms.
>
> With the patch below we take 3 seconds to complete the same test.
> The hint firmware is returning in the RTAS call should definitely
> be decreased, but even if we slept 1ms each iteration this would
> take 32s.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
> ---
>
> Index: linux-2.6/arch/powerpc/kernel/rtas.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/kernel/rtas.c 2011-04-05 11:19:35.023234011 +1000
> +++ linux-2.6/arch/powerpc/kernel/rtas.c 2011-04-07 21:25:24.646414629 +1000
> @@ -494,7 +494,7 @@ unsigned int rtas_busy_delay(int status)
>
> might_sleep();
> ms = rtas_busy_delay_time(status);
> - if (ms)
> + if (ms && need_resched())
> msleep(ms);
>
> return ms;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-07 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-07 11:54 [PATCH] rtas: Only sleep in rtas_busy_delay if we have useful work to do Anton Blanchard
2011-04-07 18:11 ` Nishanth Aravamudan
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).