ia64/xen-unstable

changeset 1888:a50c804416c5

bitkeeper revision 1.1124 (4100efefRxRv6n2bh1w2AXPtoVjT3A)

Add some pediction.
author cl349@freefall.cl.cam.ac.uk
date Fri Jul 23 11:01:03 2004 +0000 (2004-07-23)
parents 381b2b637b12
children 07a02b25fad4
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Fri Jul 23 10:21:46 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Fri Jul 23 11:01:03 2004 +0000
     1.3 @@ -1288,8 +1288,9 @@ void ptwr_reconnect_disconnected(unsigne
     1.4                           _PAGE_PRESENT);
     1.5      pl1e = map_domain_mem(l2_pgentry_to_pagenr(nl2e) << PAGE_SHIFT);
     1.6      for ( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ ) {
     1.7 -        if ((l1_pgentry_val(pl1e[i]) ^
     1.8 -             l1_pgentry_val(ptwr_disconnected_page[cpu][i])) == _PAGE_RW) {
     1.9 +        if (likely((l1_pgentry_val(pl1e[i]) ^
    1.10 +                    l1_pgentry_val(ptwr_disconnected_page[cpu][i])) ==
    1.11 +                   _PAGE_RW)) {
    1.12  #if 0
    1.13              struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(pl1e[i])];
    1.14              printk("%03x: %08lx != %08lx %08x/%08x\n", i,
    1.15 @@ -1297,7 +1298,7 @@ void ptwr_reconnect_disconnected(unsigne
    1.16                     l1_pgentry_val(pl1e[i]), page->type_and_flags,
    1.17                     page->count_and_flags);
    1.18  #endif
    1.19 -            if (readonly_page_from_l1e(pl1e[i]))
    1.20 +            if (likely(readonly_page_from_l1e(pl1e[i])))
    1.21                  continue;
    1.22          }
    1.23          if (l1_pgentry_val(pl1e[i]) != l1_pgentry_val(ptwr_disconnected_page[cpu][i])) {
    1.24 @@ -1306,7 +1307,8 @@ void ptwr_reconnect_disconnected(unsigne
    1.25                     l1_pgentry_val(ptwr_disconnected_page[cpu][i]),
    1.26                     l1_pgentry_val(pl1e[i]));
    1.27  #endif
    1.28 -            if (l1_pgentry_val(ptwr_disconnected_page[cpu][i]) & _PAGE_PRESENT)
    1.29 +            if (unlikely(l1_pgentry_val(ptwr_disconnected_page[cpu][i]) &
    1.30 +                         _PAGE_PRESENT))
    1.31                  put_page_from_l1e(ptwr_disconnected_page[cpu][i]);
    1.32              if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.33                  BUG();
    1.34 @@ -1386,7 +1388,8 @@ void ptwr_flush_inactive(void)
    1.35                         l1_pgentry_val(ptwr_writable_page[cpu][idx][i]),
    1.36                         l1_pgentry_val(pl1e[i]));
    1.37  #endif
    1.38 -                if (l1_pgentry_val(ptwr_writable_page[cpu][idx][i]) & _PAGE_PRESENT)
    1.39 +                if (unlikely(l1_pgentry_val(ptwr_writable_page[cpu][idx][i]) &
    1.40 +                             _PAGE_PRESENT))
    1.41                      put_page_from_l1e(ptwr_writable_page[cpu][idx][i]);
    1.42                  if (unlikely(!get_page_from_l1e(pl1e[i])))
    1.43                      BUG();