All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: "T.J. Alumbaugh" <talumbau@google.com>,
	qemu-devel@nongnu.org, "Yuanchu Xie" <yuanchu@google.com>,
	"Yu Zhao" <yuzhao@google.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: [RFC PATCH v2 1/5] virtio-balloon: Add Working Set Reporting feature
Date: Wed, 31 May 2023 06:28:18 -0400	[thread overview]
Message-ID: <20230531062642-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <ada6956d-028f-2c62-d3f9-3d6b2ae3c42e@redhat.com>

On Wed, May 31, 2023 at 10:12:26AM +0200, David Hildenbrand wrote:
> On 26.05.23 00:20, T.J. Alumbaugh wrote:
> 
> Hi,
> 
> please try writing a comprehensive patch description: the goal should be
> that one can understand what's happening in the single patch without all of
> the following patches at hand. [ that's how I am reading them, and ahve to
> ask many stupid questions :P ]
> 
> > Balloon header includes:
> >   - feature bit for Working Set Reporting
> >   - number of Working Set bins member in balloon config
> >   - types for communicating Working Set information
> > 
> 
> Can you briefly summarize how all the bits here interact?
> 
> I assume, once VIRTIO_BALLOON_F_WS_REPORTING has been negotiated
> 
> (1) There is a new virtqueue for sending WS-related requests from the
>     device (host) to the driver (guest).

this belongs in driver description, indeed.

> -> How does a request look like?
> -> How does a response look like?
> -> Error cases?

These last 3 are best in the spec, not in driver.

> (2) There is a new config space option.
> 
> -> Who's supposed to read this, who's supposed to write it?
> -> Can it be changed dynamically?
> -> What's the meaning / implication of that value.

same. best in spec.

> > Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
> > ---
> >   .../standard-headers/linux/virtio_balloon.h   | 20 +++++++++++++++++++
> >   1 file changed, 20 insertions(+)
> > 
> > diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h
> > index f343bfefd8..df61eaceee 100644
> > --- a/include/standard-headers/linux/virtio_balloon.h
> > +++ b/include/standard-headers/linux/virtio_balloon.h
> > @@ -37,6 +37,7 @@
> >   #define VIRTIO_BALLOON_F_FREE_PAGE_HINT	3 /* VQ to report free pages */
> >   #define VIRTIO_BALLOON_F_PAGE_POISON	4 /* Guest is using page poisoning */
> >   #define VIRTIO_BALLOON_F_REPORTING	5 /* Page reporting virtqueue */
> > +#define VIRTIO_BALLOON_F_WS_REPORTING	6 /* Working set report virtqueues */
> 
> ... are there multiple virtqueues? How many?
> 
> >   /* Size of a PFN in the balloon interface. */
> >   #define VIRTIO_BALLOON_PFN_SHIFT 12
> > @@ -59,6 +60,9 @@ struct virtio_balloon_config {
> >   	};
> >   	/* Stores PAGE_POISON if page poisoning is in use */
> >   	uint32_t poison_val;
> > +	/* Stores the number of histogram bins if WS reporting in use */
> > +	uint8_t working_set_num_bins;
> > +	uint8_t padding[3];
> >   };
> >   #define VIRTIO_BALLOON_S_SWAP_IN  0   /* Amount of memory swapped in */
> > @@ -116,4 +120,20 @@ struct virtio_balloon_stat {
> >   	__virtio64 val;
> >   } QEMU_PACKED;
> > +enum virtio_balloon_working_set_op {
> > +    VIRTIO_BALLOON_WS_REQUEST = 1, /* a Working Set request from the host */
> > +    VIRTIO_BALLOON_WS_CONFIG = 2,  /* a Working Set config from the host */
> > +};
> > +
> > +struct virtio_balloon_working_set {
> > +	/* A tag for additional metadata */
> > +	__virtio16 tag;
> > +	/* The NUMA node for this report. */
> > +	__virtio16 node_id;
> 
> How will we handle the case when the guest decides to use a different NUMA
> layout (e.g., numa disabled, fake numa, ...).
> 
> Is the guest supposed to detect that and *not* indicate a NUMA ID then?
> 
> 
> Also, I wonder
> 
> > +	uint8_t reserved[4];
> > +	__virtio64 idle_age_ms;
> > +	/* A bin each for anonymous and file-backed memory. */
> 
> Why not have them separately, and properly named?
> 
> I'm not sure if it's a good idea to distinguish them based on anon vs.
> file-backed.
> 
> What would you do with shmem? It can be swapped like anon memory, ... if
> swap is enabled.
> 
> What's the main motivation for splitting this up? Is the "file-backed" part
> supposed to give some idea about the pagecache size? But what about mlock or
> page pinning?
> 
> 
> Now I should take a step back and read the cover letter :)
> 
> -- 
> Thanks,
> 
> David / dhildenb



  reply	other threads:[~2023-05-31 10:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 22:20 [RFC PATCH v2 0/5] virtio-balloon: Working Set Reporting T.J. Alumbaugh
2023-05-25 22:20 ` [RFC PATCH v2 1/5] virtio-balloon: Add Working Set Reporting feature T.J. Alumbaugh
2023-05-31  8:12   ` David Hildenbrand
2023-05-31 10:28     ` Michael S. Tsirkin [this message]
2023-05-25 22:20 ` [RFC PATCH v2 2/5] virtio-balloon: device has Working Set Reporting T.J. Alumbaugh
2023-05-27  6:16   ` Markus Armbruster
2023-05-27  6:21   ` Markus Armbruster
2023-05-25 22:20 ` [RFC PATCH v2 3/5] virtio-balloon: Add QMP functions for Working Set T.J. Alumbaugh
2023-05-27  6:38   ` Markus Armbruster
2023-05-31  8:14   ` David Hildenbrand
2023-05-25 22:20 ` [RFC PATCH v2 4/5] virtio-balloon: Add HMP " T.J. Alumbaugh
2023-05-25 22:20 ` [RFC PATCH v2 5/5] virtio-balloon: Migration of working set config T.J. Alumbaugh
2023-05-31  8:18 ` [RFC PATCH v2 0/5] virtio-balloon: Working Set Reporting David Hildenbrand
2025-04-07  9:39 ` Michael S. Tsirkin
2025-04-09 16:52   ` Yuanchu Xie
2025-04-10  6:09     ` Michael S. Tsirkin

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=20230531062642-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=talumbau@google.com \
    --cc=wangyanan55@huawei.com \
    --cc=yuanchu@google.com \
    --cc=yuzhao@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.