lkml.org 
[lkml]   [2012]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] xen/p2m: Optimize the get_phys_to_machine function a bit.
Date
Running perf tells me that the check for p2m_identity
is done a lot - more than it should.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/xen/p2m.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 64effdc..161bcdc 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -406,7 +406,7 @@ unsigned long get_phys_to_machine(unsigned long pfn)
* and in p2m_*missing, so returning the INVALID_P2M_ENTRY
* would be wrong.
*/
- if (p2m_top[topidx][mididx] == p2m_identity)
+ if (unlikely(p2m_top[topidx][mididx] == p2m_identity))
return IDENTITY_FRAME(pfn);

return p2m_top[topidx][mididx][idx];
--
1.7.7.6


\
 
 \ /
  Last update: 2012-07-03 18:21    [W:0.077 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site