[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0d9f302a-301c-4335-9c78-bcccab824a9f@kernel.org>
Date: Wed, 10 Dec 2025 09:09:18 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Dongli Zhang <dongli.zhang@...cle.com>, virtualization@...ts.linux.dev
Cc: jasowang@...hat.com, xuanzhuo@...ux.alibaba.com, eperezma@...hat.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] virtio_balloon: do not set pr_dev_info.report
unconditionally
On 12/9/25 22:23, Dongli Zhang wrote:
> Do not set vb->pr_dev_info.report unconditionally if
> VIRTIO_BALLOON_F_REPORTING is not available.
Can you share with us why you think that should be done? Please document
the "why" and not only the "what".
Without VIRTIO_BALLOON_F_REPORTING, we'll never call
page_reporting_register(), so it will never be used.
But the compiler cannot optimize it out. It only happens during driver
loading, so I am not sure it is worth the churn?
>
> Signed-off-by: Dongli Zhang <dongli.zhang@...cle.com>
> ---
> drivers/virtio/virtio_balloon.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 74fe59f5a78c..0c39f2415324 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -1034,7 +1034,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
> poison_val, &poison_val);
> }
>
> - vb->pr_dev_info.report = virtballoon_free_page_report;
> if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING)) {
> unsigned int capacity;
>
> @@ -1044,6 +1043,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
> goto out_unregister_oom;
> }
>
> + vb->pr_dev_info.report = virtballoon_free_page_report;
> +
> /*
> * The default page reporting order is @pageblock_order, which
> * corresponds to 512MB in size on ARM64 when 64KB base page
--
Cheers
David
Powered by blists - more mailing lists