From: Balbir Singh Subject: [PATCH][RESEND]Fix GFP flags passed from the virtio balloon driver Date: Thu, 22 Apr 2010 00:37:04 +0530 Message-ID: <20100421190704.GK3994@balbir.in.ibm.com> Reply-To: balbir@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Cc: Rusty Russell , Avi Kivity , "linux-mm@kvack.org" To: kvm Return-path: Received: from e28smtp04.in.ibm.com ([122.248.162.4]:40218 "EHLO e28smtp04.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067Ab0DUTHK (ORCPT ); Wed, 21 Apr 2010 15:07:10 -0400 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp04.in.ibm.com (8.14.3/8.13.1) with ESMTP id o3LJ78m3011975 for ; Thu, 22 Apr 2010 00:37:08 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o3LJ77Hw2621538 for ; Thu, 22 Apr 2010 00:37:08 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o3LJ77kt018367 for ; Thu, 22 Apr 2010 05:07:07 +1000 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Fix GFP flags passed from the virtio balloon driver From: Balbir Singh 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 avoids printing a warning if allocation fails. Comments? Signed-off-by: Balbir Singh --- drivers/virtio/virtio_balloon.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 369f2ee..f8ffe8c 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -102,7 +102,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, -- Three Cheers, Balbir