]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
Avoid allocations causing swap activity on the resume path by allowing
authorIan Campbell <ian.campbell@citrix.com>
Mon, 14 Jan 2008 15:52:23 +0000 (15:52 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 14 Jan 2008 15:52:23 +0000 (15:52 +0000)
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@citrix.com>
drivers/xen/blkfront/blkfront.c
drivers/xen/netfront/netfront.c
drivers/xen/xenbus/xenbus_client.c
drivers/xen/xenbus/xenbus_xs.c

index 5fc9c4d1fa76e2251d40510acd4b798a046e3869..9b569ca833b268e73608568a0510bf5f689b48ff 100644 (file)
@@ -219,7 +219,7 @@ static int setup_blkring(struct xenbus_device *dev,
 
        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;
index 59155c745a14f85c306bd55879a78819ffaa1948..8abe6473b21eb81cd3992346c5867374998777d2 100644 (file)
@@ -475,7 +475,7 @@ static int setup_device(struct xenbus_device *dev, struct netfront_info *info)
        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_device *dev, struct netfront_info *info)
        }
        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");
index 4f530130e1a174167304ca7f2a33ba3b3a71bd85..10b8d9b74a5ab22eb9e3f874072a435bd95f88fe 100644 (file)
@@ -87,7 +87,7 @@ int xenbus_watch_path2(struct xenbus_device *dev, const char *path,
                                        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;
index 702e8f766c7b8ab163b4e4862877c08ac5e7e6f2..f72714da1c36aafdedbe25290d2a7666f89f4a0f 100644 (file)
@@ -291,9 +291,9 @@ static char *join(const char *dir, const char *name)
        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, unsigned int len, unsigned int *num)
        *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_transaction t,
 #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;