ia64/linux-2.6.18-xen.hg

changeset 572:5db911a71eac

Use GFP_NOIO to avoid allocations which swap on resume.

377:e8b49cfbdac0 and 497:fdb998e79aba added __GFP_HIGH to allocations
which could cause swap on resume. __GFP_HIGH actually only makes such
allocations less likely (by allowing access to the emergency pools of
memory).

See: http://marc.info/?l=linux-kernel&m=121222807617695&w=2

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Tue Jun 10 08:50:39 2008 +0100 (2008-06-10)
parents 8523584ffaa3
children e01b3a133ddc
files drivers/xen/blkfront/blkfront.c drivers/xen/netfront/netfront.c drivers/xen/xenbus/xenbus_client.c drivers/xen/xenbus/xenbus_xs.c
line diff
     1.1 --- a/drivers/xen/blkfront/blkfront.c	Tue Jun 10 08:35:59 2008 +0100
     1.2 +++ b/drivers/xen/blkfront/blkfront.c	Tue Jun 10 08:50:39 2008 +0100
     1.3 @@ -219,7 +219,7 @@ static int setup_blkring(struct xenbus_d
     1.4  
     1.5  	info->ring_ref = GRANT_INVALID_REF;
     1.6  
     1.7 -	sring = (blkif_sring_t *)__get_free_page(GFP_KERNEL|__GFP_HIGH);
     1.8 +	sring = (blkif_sring_t *)__get_free_page(GFP_NOIO | __GFP_HIGH);
     1.9  	if (!sring) {
    1.10  		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
    1.11  		return -ENOMEM;
    1.12 @@ -817,7 +817,7 @@ static void blkif_recover(struct blkfron
    1.13  	int j;
    1.14  
    1.15  	/* Stage 1: Make a safe copy of the shadow state. */
    1.16 -	copy = kmalloc(sizeof(info->shadow), GFP_KERNEL | __GFP_NOFAIL | __GFP_HIGH);
    1.17 +	copy = kmalloc(sizeof(info->shadow), GFP_NOIO | __GFP_NOFAIL | __GFP_HIGH);
    1.18  	memcpy(copy, info->shadow, sizeof(info->shadow));
    1.19  
    1.20  	/* Stage 2: Set up free list. */
     2.1 --- a/drivers/xen/netfront/netfront.c	Tue Jun 10 08:35:59 2008 +0100
     2.2 +++ b/drivers/xen/netfront/netfront.c	Tue Jun 10 08:50:39 2008 +0100
     2.3 @@ -478,7 +478,7 @@ static int setup_device(struct xenbus_de
     2.4  	info->tx.sring = NULL;
     2.5  	info->irq = 0;
     2.6  
     2.7 -	txs = (struct netif_tx_sring *)get_zeroed_page(GFP_KERNEL|__GFP_HIGH);
     2.8 +	txs = (struct netif_tx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH);
     2.9  	if (!txs) {
    2.10  		err = -ENOMEM;
    2.11  		xenbus_dev_fatal(dev, err, "allocating tx ring page");
    2.12 @@ -494,7 +494,7 @@ static int setup_device(struct xenbus_de
    2.13  	}
    2.14  	info->tx_ring_ref = err;
    2.15  
    2.16 -	rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_KERNEL|__GFP_HIGH);
    2.17 +	rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH);
    2.18  	if (!rxs) {
    2.19  		err = -ENOMEM;
    2.20  		xenbus_dev_fatal(dev, err, "allocating rx ring page");
     3.1 --- a/drivers/xen/xenbus/xenbus_client.c	Tue Jun 10 08:35:59 2008 +0100
     3.2 +++ b/drivers/xen/xenbus/xenbus_client.c	Tue Jun 10 08:50:39 2008 +0100
     3.3 @@ -87,7 +87,7 @@ int xenbus_watch_path2(struct xenbus_dev
     3.4  					const char **, unsigned int))
     3.5  {
     3.6  	int err;
     3.7 -	char *state = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s/%s", path, path2);
     3.8 +	char *state = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/%s", path, path2);
     3.9  	if (!state) {
    3.10  		xenbus_dev_fatal(dev, -ENOMEM, "allocating path for watch");
    3.11  		return -ENOMEM;
     4.1 --- a/drivers/xen/xenbus/xenbus_xs.c	Tue Jun 10 08:35:59 2008 +0100
     4.2 +++ b/drivers/xen/xenbus/xenbus_xs.c	Tue Jun 10 08:50:39 2008 +0100
     4.3 @@ -291,9 +291,9 @@ static char *join(const char *dir, const
     4.4  	char *buffer;
     4.5  
     4.6  	if (strlen(name) == 0)
     4.7 -		buffer = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s", dir);
     4.8 +		buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s", dir);
     4.9  	else
    4.10 -		buffer = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s/%s", dir, name);
    4.11 +		buffer = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/%s", dir, name);
    4.12  	return (!buffer) ? ERR_PTR(-ENOMEM) : buffer;
    4.13  }
    4.14  
    4.15 @@ -305,7 +305,7 @@ static char **split(char *strings, unsig
    4.16  	*num = count_strings(strings, len) + 1;
    4.17  
    4.18  	/* Transfer to one big alloc for easy freeing. */
    4.19 -	ret = kmalloc(*num * sizeof(char *) + len, GFP_KERNEL|__GFP_HIGH);
    4.20 +	ret = kmalloc(*num * sizeof(char *) + len, GFP_NOIO | __GFP_HIGH);
    4.21  	if (!ret) {
    4.22  		kfree(strings);
    4.23  		return ERR_PTR(-ENOMEM);
    4.24 @@ -507,7 +507,7 @@ int xenbus_printf(struct xenbus_transact
    4.25  #define PRINTF_BUFFER_SIZE 4096
    4.26  	char *printf_buffer;
    4.27  
    4.28 -	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL|__GFP_HIGH);
    4.29 +	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_NOIO | __GFP_HIGH);
    4.30  	if (printf_buffer == NULL)
    4.31  		return -ENOMEM;
    4.32  
    4.33 @@ -791,7 +791,7 @@ static int process_msg(void)
    4.34  	}
    4.35  
    4.36  
    4.37 -	msg = kmalloc(sizeof(*msg), GFP_KERNEL|__GFP_HIGH);
    4.38 +	msg = kmalloc(sizeof(*msg), GFP_NOIO | __GFP_HIGH);
    4.39  	if (msg == NULL) {
    4.40  		err = -ENOMEM;
    4.41  		goto out;
    4.42 @@ -803,7 +803,7 @@ static int process_msg(void)
    4.43  		goto out;
    4.44  	}
    4.45  
    4.46 -	body = kmalloc(msg->hdr.len + 1, GFP_KERNEL|__GFP_HIGH);
    4.47 +	body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);
    4.48  	if (body == NULL) {
    4.49  		kfree(msg);
    4.50  		err = -ENOMEM;