All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio: don't warn if we can't allocate indirect sglist
@ 2016-07-11 17:22 Mikulas Patocka
  2016-07-12  7:30 ` Christian Borntraeger
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2016-07-11 17:22 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: virtualization

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>

---
 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] virtio: don't warn if we can't allocate indirect sglist
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Borntraeger @ 2016-07-12  7:30 UTC (permalink / raw)
  To: Mikulas Patocka, Michael S. Tsirkin; +Cc: virtualization

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-12  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.