2009-01-15 15:50:06

by Cliff Wickman

[permalink] [raw]
Subject: [PATCH] UV: cpu_relax in uv_wait_completion


From: Cliff Wickman <[email protected]>

The function uv_wait_completion() spins on reads of a memory-mapped
register, waiting for completion of BAU hardware replies.
It should call "cpu_relax()" between those reads to improve performance
on hyperthreaded configurations.

Signed-off-by: Cliff Wickman <[email protected]>
Acked-by: Jack Steiner <[email protected]>

---
arch/x86/kernel/tlb_uv.c | 1 +
1 file changed, 1 insertion(+)

Index: linux/arch/x86/kernel/tlb_uv.c
===================================================================
--- linux.orig/arch/x86/kernel/tlb_uv.c
+++ linux/arch/x86/kernel/tlb_uv.c
@@ -200,6 +200,7 @@ static int uv_wait_completion(struct bau
destination_timeouts = 0;
}
}
+ cpu_relax();
}
return FLUSH_COMPLETE;
}


2009-01-15 17:57:49

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] UV: cpu_relax in uv_wait_completion


* Cliff Wickman <[email protected]> wrote:

>
> From: Cliff Wickman <[email protected]>
>
> The function uv_wait_completion() spins on reads of a memory-mapped
> register, waiting for completion of BAU hardware replies.
> It should call "cpu_relax()" between those reads to improve performance
> on hyperthreaded configurations.
>
> Signed-off-by: Cliff Wickman <[email protected]>
> Acked-by: Jack Steiner <[email protected]>
>
> ---
> arch/x86/kernel/tlb_uv.c | 1 +
> 1 file changed, 1 insertion(+)

applied to tip/x86/urgent, thanks Cliff!

Ingo