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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3820c098-504a-c4d2-2832-dea6b8d282c4@redhat.com>
Date:   Tue, 19 Nov 2019 12:38:59 +0100
From:   David Hildenbrand <david@...hat.com>
To:     "Michael S. Tsirkin" <mst@...hat.com>, linux-kernel@...r.kernel.org
Cc:     Wei Wang <wei.w.wang@...el.com>, stable@...r.kernel.org,
        Jason Wang <jasowang@...hat.com>,
        virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH] virtio_balloon: fix shrinker count

On 19.11.19 11:18, Michael S. Tsirkin wrote:
> From: Wei Wang <wei.w.wang@...el.com>
> 
> Instead of multiplying by page order, virtio balloon divided by page
> order. The result is that it can often 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@...r.kernel.org
> Fixes: 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker")
> Signed-off-by: Wei Wang <wei.w.wang@...el.com>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> ---
>   drivers/virtio/virtio_balloon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 7cee05cdf3fb..65df40f261ab 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -825,7 +825,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;
>   }
> 

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ