From: Amit Shah <amit.shah@redhat.com> Date: Thu, 22 Apr 2010 07:59:00 -0400 Subject: [virtio] fix GFP flags passed by virtio balloon driver Message-id: <1271923140-13369-1-git-send-email-amit.shah@redhat.com> Patchwork-id: 24292 O-Subject: [RHEL5.6 PATCH] virtio: Fix GFP flags passed from the virtio balloon driver Bugzilla: 584683 RH-Acked-by: Michael S. Tsirkin <mst@redhat.com> From: Balbir Singh <balbir@linux.vnet.ibm.com> The virtio balloon driver can dig into the reservation pools of the OS to satisfy a balloon request. This is not advisable and other balloon drivers (drivers/xen/balloon.c) avoid this as well. The patch also adds changes to avoid printing a warning if allocation fails, since we retry after sometime anyway. Bugzilla: 584683 Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: kvm <kvm@vger.kernel.org> Cc: stable@kernel.org Signed-off-by: Amit Shah <amit.shah@redhat.com> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3e16229..b5b5d26 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -100,7 +100,8 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) num = min(num, ARRAY_SIZE(vb->pfns)); for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) { - struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY); + struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY | + __GFP_NOMEMALLOC | __GFP_NOWARN); if (!page) { if (printk_ratelimit()) dev_printk(KERN_INFO, &vb->vdev->dev,