ia64/xen-unstable

changeset 19306:5e4dd7079c48

[IA64] ia64 counter part of 19374:e655cb27d085.

This patch is the ia64 counter part of 19374:e655cb27d085.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Mar 27 10:54:08 2009 +0900 (2009-03-27)
parents dee5bc89873e
children e54eeff2de54
files xen/include/asm-ia64/mm.h
line diff
     1.1 --- a/xen/include/asm-ia64/mm.h	Tue Mar 10 11:00:34 2009 +0900
     1.2 +++ b/xen/include/asm-ia64/mm.h	Fri Mar 27 10:54:08 2009 +0900
     1.3 @@ -228,10 +228,18 @@ static inline struct domain *page_get_ow
     1.4  
     1.5      do {
     1.6          x = y;
     1.7 -        if (unlikely((x & PGC_count_mask) == 0) ||  /* Not allocated? */
     1.8 -            unlikely(((x + 1) & PGC_count_mask) == 0) ) {/* Count overflow? */
     1.9 +        /*
    1.10 +         * Count ==  0: Page is not allocated, so we cannot take a reference.
    1.11 +         * Count == -1: Reference count would wrap, which is invalid.
    1.12 +         * Count == -2: Remaining unused ref is reserved for get_page_light().
    1.13 +         */
    1.14 +        /*
    1.15 +         * On ia64, get_page_light() isn't defined so that it doesn't
    1.16 +         * make sense to take care of Count == -2.
    1.17 +         * Just for consistency with x86.
    1.18 +         */
    1.19 +        if ( unlikely(((x + 2) & PGC_count_mask) <= 2) )
    1.20              return NULL;
    1.21 -        }
    1.22          y = cmpxchg_acq(&page->count_info, x, x + 1);
    1.23      } while (unlikely(y != x));
    1.24  
    1.25 @@ -247,7 +255,8 @@ static inline int get_page(struct page_i
    1.26      if (likely(owner == domain))
    1.27          return 1;
    1.28  
    1.29 -    put_page(page);
    1.30 +    if (owner != NULL)
    1.31 +        put_page(page);
    1.32  
    1.33      /* if (!domain->is_dying) */ /* XXX: header inclusion hell */
    1.34      gdprintk(XENLOG_INFO,