]> xenbits.xensource.com Git - xen.git/commitdiff
[LINUX] When ballooning out (returning memory to xen), don't try too hard
authorshand@kneesaa.uk.xensource.com <shand@kneesaa.uk.xensource.com>
Thu, 29 Jun 2006 14:02:38 +0000 (15:02 +0100)
committershand@kneesaa.uk.xensource.com <shand@kneesaa.uk.xensource.com>
Thu, 29 Jun 2006 14:02:38 +0000 (15:02 +0100)
to allocate pages - this reduces the chance of the oom killer being invoked.

Signed-off-by: Steven Hand <steven@xensource.com>
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c

index dcddf01ad77eed70e34a8785ec985ff06c3c1a96..95117b92ccd97315449ee0b4a4c6d96b81e03819 100644 (file)
@@ -99,6 +99,11 @@ static void balloon_process(void *unused);
 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 long nr_pages)
                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;