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

[Xen-changelog] [xen-3.1-testing] Avoid allocations causing swap activity on the resume path by allowing



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1201001543 0
# Node ID d13ebcc0013dd6f5b9beb3c9503cf08fff57337b
# Parent  8aa1cae76e082b45b7f073e036197ad1898ffa6e
Avoid allocations causing swap activity on the resume path by allowing
such allocations to access the emergency pools otherwise a
save/restore/migration of a guest which is low on memory can
deadlock.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
linux-2.6.18-xen changeset:   377:e8b49cfbdac0c5ee680cd9ec3d693ed0e2d42432
linux-2.6.18-xen date:        Mon Jan 14 15:52:23 2008 +0000
---
 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c    |    2 +-
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c    |    4 ++--
 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c |    2 +-
 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c     |   12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -r 8aa1cae76e08 -r d13ebcc0013d 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Jan 22 
11:27:43 2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Jan 22 
11:32:23 2008 +0000
@@ -219,7 +219,7 @@ static int setup_blkring(struct xenbus_d
 
        info->ring_ref = GRANT_INVALID_REF;
 
-       sring = (blkif_sring_t *)__get_free_page(GFP_KERNEL);
+       sring = (blkif_sring_t *)__get_free_page(GFP_KERNEL|__GFP_HIGH);
        if (!sring) {
                xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
                return -ENOMEM;
diff -r 8aa1cae76e08 -r d13ebcc0013d 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Tue Jan 22 
11:27:43 2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Tue Jan 22 
11:32:23 2008 +0000
@@ -498,7 +498,7 @@ static int setup_device(struct xenbus_de
        info->tx.sring = NULL;
        info->irq = 0;
 
-       txs = (struct netif_tx_sring *)get_zeroed_page(GFP_KERNEL);
+       txs = (struct netif_tx_sring *)get_zeroed_page(GFP_KERNEL|__GFP_HIGH);
        if (!txs) {
                err = -ENOMEM;
                xenbus_dev_fatal(dev, err, "allocating tx ring page");
@@ -514,7 +514,7 @@ static int setup_device(struct xenbus_de
        }
        info->tx_ring_ref = err;
 
-       rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_KERNEL);
+       rxs = (struct netif_rx_sring *)get_zeroed_page(GFP_KERNEL|__GFP_HIGH);
        if (!rxs) {
                err = -ENOMEM;
                xenbus_dev_fatal(dev, err, "allocating rx ring page");
diff -r 8aa1cae76e08 -r d13ebcc0013d 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c   Tue Jan 22 
11:27:43 2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c   Tue Jan 22 
11:32:23 2008 +0000
@@ -86,7 +86,7 @@ int xenbus_watch_path2(struct xenbus_dev
                                        const char **, unsigned int))
 {
        int err;
-       char *state = kasprintf(GFP_KERNEL, "%s/%s", path, path2);
+       char *state = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s/%s", path, path2);
        if (!state) {
                xenbus_dev_fatal(dev, -ENOMEM, "allocating path for watch");
                return -ENOMEM;
diff -r 8aa1cae76e08 -r d13ebcc0013d 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Tue Jan 22 
11:27:43 2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Tue Jan 22 
11:32:23 2008 +0000
@@ -291,9 +291,9 @@ static char *join(const char *dir, const
        char *buffer;
 
        if (strlen(name) == 0)
-               buffer = kasprintf(GFP_KERNEL, "%s", dir);
+               buffer = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s", dir);
        else
-               buffer = kasprintf(GFP_KERNEL, "%s/%s", dir, name);
+               buffer = kasprintf(GFP_KERNEL|__GFP_HIGH, "%s/%s", dir, name);
        return (!buffer) ? ERR_PTR(-ENOMEM) : buffer;
 }
 
@@ -305,7 +305,7 @@ static char **split(char *strings, unsig
        *num = count_strings(strings, len);
 
        /* Transfer to one big alloc for easy freeing. */
-       ret = kmalloc(*num * sizeof(char *) + len, GFP_KERNEL);
+       ret = kmalloc(*num * sizeof(char *) + len, GFP_KERNEL|__GFP_HIGH);
        if (!ret) {
                kfree(strings);
                return ERR_PTR(-ENOMEM);
@@ -506,7 +506,7 @@ int xenbus_printf(struct xenbus_transact
 #define PRINTF_BUFFER_SIZE 4096
        char *printf_buffer;
 
-       printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL);
+       printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL|__GFP_HIGH);
        if (printf_buffer == NULL)
                return -ENOMEM;
 
@@ -775,7 +775,7 @@ static int process_msg(void)
        }
 
 
-       msg = kmalloc(sizeof(*msg), GFP_KERNEL);
+       msg = kmalloc(sizeof(*msg), GFP_KERNEL|__GFP_HIGH);
        if (msg == NULL) {
                err = -ENOMEM;
                goto out;
@@ -787,7 +787,7 @@ static int process_msg(void)
                goto out;
        }
 
-       body = kmalloc(msg->hdr.len + 1, GFP_KERNEL);
+       body = kmalloc(msg->hdr.len + 1, GFP_KERNEL|__GFP_HIGH);
        if (body == NULL) {
                kfree(msg);
                err = -ENOMEM;

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