From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Michael Kelley <mhklinux@outlook.com>,
Dongli Zhang <dongli.zhang@oracle.com>,
"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"eperezma@redhat.com" <eperezma@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] virtio_balloon: do not set pr_dev_info.report unconditionally
Date: Thu, 18 Dec 2025 09:34:55 +0100 [thread overview]
Message-ID: <591e102d-e8cc-4e9b-9fa2-cf5a782ed40b@kernel.org> (raw)
In-Reply-To: <BN7PR02MB4148C75ACA806BAEEEC4351BD4ABA@BN7PR02MB4148.namprd02.prod.outlook.com>
On 12/17/25 05:52, Michael Kelley wrote:
> From: Dongli Zhang <dongli.zhang@oracle.com> Sent: Wednesday, December 10, 2025 11:10 AM
>>
>> Hi David,
>>
>> On 12/10/25 12:09 AM, David Hildenbrand (Red Hat) wrote:
>>> 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?
>>
>> When I was reading about the free-page reporting feature in virtio-balloon, I
>> was confused as to why pr_dev_info.report was always configured unconditionally.
>>
>> Later, I looked at the implementation in the Hyper-V balloon driver and noticed
>> that it even resets pr_dev_info.report back to NULL if page_reporting_register()
>> fails (see line 1669).
>
> The Hyper-V balloon driver does this because it uses the NULL in pr_dev_info.report
> to indicate if page_reporting_unregister() should be called when the driver exits.
> See disable_page_reporting(). Unlike the virtio balloon driver, the Hyper-V
> balloon_probe() function succeeds even if page_reporting_register() fails, so
> some indicator is needed on exit. I didn't look super carefully, but it appears the
> virtio balloon driver doesn't need such an indicator.
Nothing is broken AFAIKT.
The patch description should be updated to reflect why we would want to
do that given that nothing is broken.
No strong opinion on the patch with an updated patch description from my
side.
--
Cheers
David
prev parent reply other threads:[~2025-12-18 8:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 21:23 [PATCH 1/1] virtio_balloon: do not set pr_dev_info.report unconditionally Dongli Zhang
2025-12-10 8:09 ` David Hildenbrand (Red Hat)
2025-12-10 19:10 ` Dongli Zhang
2025-12-17 4:52 ` Michael Kelley
2025-12-18 8:34 ` David Hildenbrand (Red Hat) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=591e102d-e8cc-4e9b-9fa2-cf5a782ed40b@kernel.org \
--to=david@kernel.org \
--cc=dongli.zhang@oracle.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).