ia64/xen-unstable

changeset 1025:7e0ecccb1426

bitkeeper revision 1.665 (3ff5f396dL-6bJmbLG-ndBZSRPB8NA)

domain.c:
Fix refcnt leak in domain teardown.
author kaf24@scramble.cl.cam.ac.uk
date Fri Jan 02 22:41:26 2004 +0000 (2004-01-02)
parents 8d970a3b60cc
children 50fc09c0f9d7
files xen/common/domain.c
line diff
     1.1 --- a/xen/common/domain.c	Fri Jan 02 15:16:55 2004 +0000
     1.2 +++ b/xen/common/domain.c	Fri Jan 02 22:41:26 2004 +0000
     1.3 @@ -345,6 +345,11 @@ void free_all_dom_mem(struct task_struct
     1.4  
     1.5      INIT_LIST_HEAD(&zombies);
     1.6  
     1.7 +    /* STEP 1. Drop the in-use reference to the page-table base. */
     1.8 +    put_page_and_type(&frame_table[pagetable_val(p->mm.pagetable) >>
     1.9 +                                  PAGE_SHIFT]);
    1.10 +
    1.11 +    /* STEP 2. Zombify all pages on the domain's allocation list. */
    1.12      spin_lock(&p->page_list_lock);
    1.13      while ( (ent = p->page_list.next) != &p->page_list )
    1.14      {
    1.15 @@ -372,7 +377,10 @@ void free_all_dom_mem(struct task_struct
    1.16      }
    1.17      spin_unlock(&p->page_list_lock);
    1.18  
    1.19 -    /* We do the potentially complex 'put' operations with no lock held. */
    1.20 +    /*
    1.21 +     * STEP 3. With the domain's list lock now released, we examine each zombie
    1.22 +     * page and drop references for guest-allocated and/or type-pinned pages.
    1.23 +     */
    1.24      while ( (ent = zombies.next) != &zombies )
    1.25      {
    1.26          page = list_entry(ent, struct pfn_info, list);