[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xen/balloon: prefer using pages from balloon in alloc_empty_pages_and_pagevec()



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1260981813 0
# Node ID 7a52ef05b612c8c8ea708a9175d49799a36cc4e2
# Parent  5e08fff8dc05977d802d0aa2b71f010e473ca085
xen/balloon: prefer using pages from balloon in alloc_empty_pages_and_pagevec()

This is both faster and less demanding on kernel resources.

Likely also something that could be done in the pv-ops tree (though it
would need some adjustment to deal with the balloon_order!=0 case).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/balloon/balloon.c |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -r 5e08fff8dc05 -r 7a52ef05b612 drivers/xen/balloon/balloon.c
--- a/drivers/xen/balloon/balloon.c     Fri Dec 11 08:47:19 2009 +0000
+++ b/drivers/xen/balloon/balloon.c     Wed Dec 16 16:43:33 2009 +0000
@@ -602,6 +602,17 @@ struct page **alloc_empty_pages_and_page
                return NULL;
 
        for (i = 0; i < nr_pages; i++) {
+               balloon_lock(flags);
+               page = balloon_first_page();
+               if (page && !PageHighMem(page)) {
+                       UNLIST_PAGE(page);
+                       bs.balloon_low--;
+                       balloon_unlock(flags);
+                       pagevec[i] = page;
+                       continue;
+               }
+               balloon_unlock(flags);
+
                page = pagevec[i] = alloc_page(GFP_KERNEL|__GFP_COLD);
                if (page == NULL)
                        goto err;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.