]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
Avoid allocations causing swap activity on the resume path by allowing
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Jan 2008 11:32:23 +0000 (11:32 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Jan 2008 11:32:23 +0000 (11:32 +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>
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
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c

index d13a63f6d5fcd36d032c6d8b055251f75f605000..e2f6b5809be8eec491aeb14562a41471095cbbcc 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 e89a11171ba50de12007b9497c0e19bd5b564491..d1a279992f7b81bc6db0c266a92f39c1ae119192 100644 (file)
@@ -498,7 +498,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");
@@ -514,7 +514,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 49878d17e07d7c25cccd328bd030dcfe3a1afc15..6a5cbf4018622e389a893c784f61049beb6c7b8c 100644 (file)
@@ -86,7 +86,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;