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

[Xen-changelog] [xen-unstable] [LINUX] When ballooning out (returning memory to xen), don't try too hard



# HG changeset patch
# User shand@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 8242c0c24db75c7de381b69637b7b1be3f4780f1
# Parent  c157418212d820f03552f8dff87b2859fa2257e1
[LINUX] When ballooning out (returning memory to xen), don't try too hard 
to allocate pages - this reduces the chance of the oom killer being invoked. 

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -r c157418212d8 -r 8242c0c24db7 
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Thu Jun 29 
14:49:41 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Thu Jun 29 
15:02:38 2006 +0100
@@ -99,6 +99,11 @@ static DECLARE_WORK(balloon_worker, ball
 static DECLARE_WORK(balloon_worker, balloon_process, NULL);
 static struct timer_list balloon_timer;
 
+/* When ballooning out (allocating memory to return to Xen) we don't really 
+   want the kernel to try too hard since that can trigger the oom killer. */
+#define GFP_BALLOON \
+       (GFP_HIGHUSER | __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC)
+
 #define PAGE_TO_LIST(p) (&(p)->lru)
 #define LIST_TO_PAGE(l) list_entry((l), struct page, lru)
 #define UNLIST_PAGE(p)                         \
@@ -269,7 +274,7 @@ static int decrease_reservation(unsigned
                nr_pages = ARRAY_SIZE(frame_list);
 
        for (i = 0; i < nr_pages; i++) {
-               if ((page = alloc_page(GFP_HIGHUSER)) == NULL) {
+               if ((page = alloc_page(GFP_BALLOON)) == NULL) {
                        nr_pages = i;
                        need_sleep = 1;
                        break;

_______________________________________________
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®.