stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] virtio_balloon: fix shrinker count" failed to apply to 4.19-stable tree
@ 2019-11-25 17:44 gregkh
  2019-11-27  2:23 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2019-11-25 17:44 UTC (permalink / raw)
  To: wei.w.wang, david, mst; +Cc: stable


The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c9a6820fc0da2603be3054ee7590eb9f350508a7 Mon Sep 17 00:00:00 2001
From: Wei Wang <wei.w.wang@intel.com>
Date: Tue, 19 Nov 2019 05:02:33 -0500
Subject: [PATCH] virtio_balloon: fix shrinker count

Instead of multiplying by page order, virtio balloon divided by page
order. The result is that it can return 0 if there are a bit less
than MAX_ORDER - 1 pages in use, and then shrinker scan won't be called.

Cc: stable@vger.kernel.org
Fixes: 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker")
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 51134f9a3ee7..e05679c478e2 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -826,7 +826,7 @@ static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker,
 	unsigned long count;
 
 	count = vb->num_pages / VIRTIO_BALLOON_PAGES_PER_PAGE;
-	count += vb->num_free_page_blocks >> VIRTIO_BALLOON_FREE_PAGE_ORDER;
+	count += vb->num_free_page_blocks << VIRTIO_BALLOON_FREE_PAGE_ORDER;
 
 	return count;
 }


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

* Re: FAILED: patch "[PATCH] virtio_balloon: fix shrinker count" failed to apply to 4.19-stable tree
  2019-11-25 17:44 FAILED: patch "[PATCH] virtio_balloon: fix shrinker count" failed to apply to 4.19-stable tree gregkh
@ 2019-11-27  2:23 ` Sasha Levin
  2019-11-27 14:30   ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2019-11-27  2:23 UTC (permalink / raw)
  To: gregkh; +Cc: wei.w.wang, david, mst, stable

On Mon, Nov 25, 2019 at 06:44:42PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From c9a6820fc0da2603be3054ee7590eb9f350508a7 Mon Sep 17 00:00:00 2001
>From: Wei Wang <wei.w.wang@intel.com>
>Date: Tue, 19 Nov 2019 05:02:33 -0500
>Subject: [PATCH] virtio_balloon: fix shrinker count
>
>Instead of multiplying by page order, virtio balloon divided by page
>order. The result is that it can return 0 if there are a bit less
>than MAX_ORDER - 1 pages in use, and then shrinker scan won't be called.
>
>Cc: stable@vger.kernel.org
>Fixes: 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker")
>Signed-off-by: Wei Wang <wei.w.wang@intel.com>
>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>Reviewed-by: David Hildenbrand <david@redhat.com>

I think that the fixes tag should be pointing to 86a559787e6f
("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT"), and this commit
isn't needed on 4.19.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] virtio_balloon: fix shrinker count" failed to apply to 4.19-stable tree
  2019-11-27  2:23 ` Sasha Levin
@ 2019-11-27 14:30   ` Michael S. Tsirkin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2019-11-27 14:30 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, wei.w.wang, david, stable

On Tue, Nov 26, 2019 at 09:23:59PM -0500, Sasha Levin wrote:
> On Mon, Nov 25, 2019 at 06:44:42PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.19-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > From c9a6820fc0da2603be3054ee7590eb9f350508a7 Mon Sep 17 00:00:00 2001
> > From: Wei Wang <wei.w.wang@intel.com>
> > Date: Tue, 19 Nov 2019 05:02:33 -0500
> > Subject: [PATCH] virtio_balloon: fix shrinker count
> > 
> > Instead of multiplying by page order, virtio balloon divided by page
> > order. The result is that it can return 0 if there are a bit less
> > than MAX_ORDER - 1 pages in use, and then shrinker scan won't be called.
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker")
> > Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > Reviewed-by: David Hildenbrand <david@redhat.com>
> 
> I think that the fixes tag should be pointing to 86a559787e6f
> ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT"), and this commit
> isn't needed on 4.19.

I believe you are right but don't see a way to fix that as the patch is
upstream.

> -- 
> Thanks,
> Sasha


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

end of thread, other threads:[~2019-11-27 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 17:44 FAILED: patch "[PATCH] virtio_balloon: fix shrinker count" failed to apply to 4.19-stable tree gregkh
2019-11-27  2:23 ` Sasha Levin
2019-11-27 14:30   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).