ia64/xen-unstable

changeset 10601:8242c0c24db7

[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@xensource.com>
author shand@kneesaa.uk.xensource.com
date Thu Jun 29 15:02:38 2006 +0100 (2006-06-29)
parents c157418212d8
children 3dfc2583a4f1
files linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Jun 29 14:49:41 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Jun 29 15:02:38 2006 +0100
     1.3 @@ -99,6 +99,11 @@ static void balloon_process(void *unused
     1.4  static DECLARE_WORK(balloon_worker, balloon_process, NULL);
     1.5  static struct timer_list balloon_timer;
     1.6  
     1.7 +/* When ballooning out (allocating memory to return to Xen) we don't really 
     1.8 +   want the kernel to try too hard since that can trigger the oom killer. */
     1.9 +#define GFP_BALLOON \
    1.10 +	(GFP_HIGHUSER | __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC)
    1.11 +
    1.12  #define PAGE_TO_LIST(p) (&(p)->lru)
    1.13  #define LIST_TO_PAGE(l) list_entry((l), struct page, lru)
    1.14  #define UNLIST_PAGE(p)				\
    1.15 @@ -269,7 +274,7 @@ static int decrease_reservation(unsigned
    1.16  		nr_pages = ARRAY_SIZE(frame_list);
    1.17  
    1.18  	for (i = 0; i < nr_pages; i++) {
    1.19 -		if ((page = alloc_page(GFP_HIGHUSER)) == NULL) {
    1.20 +		if ((page = alloc_page(GFP_BALLOON)) == NULL) {
    1.21  			nr_pages = i;
    1.22  			need_sleep = 1;
    1.23  			break;