Linux virtualization list
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Mikulas Patocka <mpatocka@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio: don't warn if we can't allocate indirect sglist
Date: Tue, 12 Jul 2016 09:30:55 +0200	[thread overview]
Message-ID: <57849CAF.9040907@de.ibm.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1607111320530.25989@file01.intranet.prod.int.rdu2.redhat.com>

On 07/11/2016 07:22 PM, Mikulas Patocka wrote:
> Don't print warning if memory allocation fails. The virtio driver can
> handle allocation failure (it falls back to direct sglist), so there is
> no functionality degradation.
> 
> This warning was observed when swapping to virtio scsi device because
> there may be not enough free memory during swapping.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> ---
>  drivers/virtio/virtio_ring.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> Index: linux-4.7-rc7/drivers/virtio/virtio_ring.c
> ===================================================================
> --- linux-4.7-rc7.orig/drivers/virtio/virtio_ring.c	2016-05-09 17:45:04.000000000 +0200
> +++ linux-4.7-rc7/drivers/virtio/virtio_ring.c	2016-07-11 17:30:20.000000000 +0200
> @@ -237,6 +237,12 @@ static struct vring_desc *alloc_indirect
>  	 */
>  	gfp &= ~__GFP_HIGHMEM;
> 
> +	/*
> +	 * Don't warn if the allocation fails, because the driver
> +	 * handles allocation failures gracefully.
> +	 */
> +	gfp |= __GFP_NOWARN;
> +
>  	desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp);
>  	if (!desc)
>  		return NULL;
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
> 

      reply	other threads:[~2016-07-12  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 17:22 [PATCH] virtio: don't warn if we can't allocate indirect sglist Mikulas Patocka
2016-07-12  7:30 ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57849CAF.9040907@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=mpatocka@redhat.com \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox