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

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



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1200325943 0
# Node ID e8b49cfbdac0c5ee680cd9ec3d693ed0e2d42432
# Parent  353802ec1caf399143e48713a04cedd37a106347
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>
---
 drivers/xen/blkfront/blkfront.c    |    2 +-
 drivers/xen/netfront/netfront.c    |    4 ++--
 drivers/xen/xenbus/xenbus_client.c |    2 +-
 drivers/xen/xenbus/xenbus_xs.c     |   12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -r 353802ec1caf -r e8b49cfbdac0 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Wed Jan 09 22:12:32 2008 +0000
+++ b/drivers/xen/blkfront/blkfront.c   Mon Jan 14 15:52: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 353802ec1caf -r e8b49cfbdac0 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Wed Jan 09 22:12:32 2008 +0000
+++ b/drivers/xen/netfront/netfront.c   Mon Jan 14 15:52:23 2008 +0000
@@ -475,7 +475,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");
@@ -491,7 +491,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 353802ec1caf -r e8b49cfbdac0 drivers/xen/xenbus/xenbus_client.c
--- a/drivers/xen/xenbus/xenbus_client.c        Wed Jan 09 22:12:32 2008 +0000
+++ b/drivers/xen/xenbus/xenbus_client.c        Mon Jan 14 15:52:23 2008 +0000
@@ -87,7 +87,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 353802ec1caf -r e8b49cfbdac0 drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c    Wed Jan 09 22:12:32 2008 +0000
+++ b/drivers/xen/xenbus/xenbus_xs.c    Mon Jan 14 15:52: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®.