WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] balloon_alloc_empty_page_range() should set the referenc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] balloon_alloc_empty_page_range() should set the reference count
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Apr 2006 11:12:09 +0000
Delivery-date: Sun, 30 Apr 2006 04:29:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 369bdfa1e04aa5097440eb0cd548d4e2033365ae
# Parent  0ee104bd65570382ac408ccaa480192d9d047452
balloon_alloc_empty_page_range() should set the reference count
on every page structure before returning.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 0ee104bd6557 -r 369bdfa1e04a 
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Sun Apr 30 
09:26:01 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Sun Apr 30 
09:32:21 2006 +0100
@@ -540,6 +540,8 @@ struct page *balloon_alloc_empty_page_ra
        unsigned long vstart, flags;
        unsigned int  order = get_order(nr_pages * PAGE_SIZE);
        int ret;
+       unsigned long i;
+       struct page *page;
 
        vstart = __get_free_pages(GFP_KERNEL, order);
        if (vstart == 0)
@@ -559,7 +561,12 @@ struct page *balloon_alloc_empty_page_ra
 
        flush_tlb_all();
 
-       return virt_to_page(vstart);
+       page = virt_to_page(vstart);
+
+       for (i = 0; i < (1UL << order); i++)
+               set_page_count(page + i, 1);
+
+       return page;
 }
 
 void balloon_dealloc_empty_page_range(
@@ -569,8 +576,10 @@ void balloon_dealloc_empty_page_range(
        unsigned int  order = get_order(nr_pages * PAGE_SIZE);
 
        balloon_lock(flags);
-       for (i = 0; i < (1UL << order); i++)
+       for (i = 0; i < (1UL << order); i++) {
+               BUG_ON(page_count(page + i) != 1);
                balloon_append(page + i);
+       }
        balloon_unlock(flags);
 
        schedule_work(&balloon_worker);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] balloon_alloc_empty_page_range() should set the reference count, Xen patchbot -unstable <=