lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191118213811.22017-2-khazhy@google.com>
Date:   Mon, 18 Nov 2019 13:38:11 -0800
From:   Khazhismel Kumykov <khazhy@...gle.com>
To:     mst@...hat.com, jasowang@...hat.com, wei.w.wang@...el.com
Cc:     linux-kernel@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        Khazhismel Kumykov <khazhy@...gle.com>
Subject: [PATCH 2/2] virtio_balloon: fix shrinker_scan return units

We were returning number of virtio balloon pages, which may not be the
same as number of system pages

Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
Cc: Wei Wang <wei.w.wang@...el.com>
Signed-off-by: Khazhismel Kumykov <khazhy@...gle.com>
---
 drivers/virtio/virtio_balloon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 7cf9540a40b8..7951ece3fe24 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -802,11 +802,11 @@ static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker,
 		pages_freed = shrink_free_pages(vb, pages_to_free);
 
 	if (pages_freed >= pages_to_free)
-		return pages_freed;
+		return pages_freed / VIRTIO_BALLOON_PAGES_PER_PAGE;
 
 	pages_freed += shrink_balloon_pages(vb, pages_to_free - pages_freed);
 
-	return pages_freed;
+	return pages_freed / VIRTIO_BALLOON_PAGES_PER_PAGE;
 }
 
 static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker,
-- 
2.24.0.432.g9d3f5f5b63-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ