direct-io.hg

changeset 2291:56635b4b9dc0

bitkeeper revision 1.1159.42.1 (412498cfQR0FW9Xp4EVER4lafeJgXQ)

Fix page allocator to properly free anonymous pages to the domain zone.
author kaf24@scramble.cl.cam.ac.uk
date Thu Aug 19 12:10:55 2004 +0000 (2004-08-19)
parents 6a83ce7a1b78
children c8a29df316b8 ada3a221df8d
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Wed Aug 18 17:51:12 2004 +0000
     1.2 +++ b/xen/common/page_alloc.c	Thu Aug 19 12:10:55 2004 +0000
     1.3 @@ -422,7 +422,7 @@ void free_domheap_pages(struct pfn_info 
     1.4          drop_dom_ref = (d->xenheap_pages == 0);
     1.5          spin_unlock_recursive(&d->page_alloc_lock);
     1.6      }
     1.7 -    else
     1.8 +    else if ( likely(d != NULL) )
     1.9      {
    1.10          /* NB. May recursively lock from domain_relinquish_memory(). */
    1.11          spin_lock_recursive(&d->page_alloc_lock);
    1.12 @@ -442,6 +442,12 @@ void free_domheap_pages(struct pfn_info 
    1.13  
    1.14          free_heap_pages(MEMZONE_DOM, pg, order);
    1.15      }
    1.16 +    else
    1.17 +    {
    1.18 +        /* Freeing an anonymous domain-heap page. */
    1.19 +        free_heap_pages(MEMZONE_DOM, pg, order);
    1.20 +        drop_dom_ref = 0;
    1.21 +    }
    1.22  
    1.23      if ( drop_dom_ref )
    1.24          put_domain(d);