lkml.org 
[lkml]   [2021]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] virtio-balloon: move release_pages_balloon() outside of mutex_unlock(&vb->balloon_lock)
From
Date
On 26.03.21 10:53, Liu Xiang wrote:
> Since pages have been deflated to a local list,
> there is no race between fill and leak.
>
> Signed-off-by: Liu Xiang <liu.xiang@zlingsmart.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 8985fc2ce..7da25b87f 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -303,8 +303,8 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
> */
> if (vb->num_pfns != 0)
> tell_host(vb, vb->deflate_vq);
> - release_pages_balloon(vb, &pages);
> mutex_unlock(&vb->balloon_lock);
> + release_pages_balloon(vb, &pages);
> return num_freed_pages;
> }
>
>

I think this should be fine

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

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2021-03-26 12:15    [W:0.052 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site