All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian M?ller <max06.net@outlook.com>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>,
	vkuznets <vkuznets@redhat.com>
Cc: "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	David Hildenbrand <dhildenb@redhat.com>
Subject: AW: hv_balloon: Only works in ubuntu
Date: Mon, 13 Jun 2022 14:45:56 +0000	[thread overview]
Message-ID: <DB3PR0602MB36748AD171E0F1501C7D1898FFAB9@DB3PR0602MB3674.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <PH0PR21MB302540EAB2DF0A368AF4BC57D7AB9@PH0PR21MB3025.namprd21.prod.outlook.com>

> Von: Michael Kelley (LINUX) <mikelley@microsoft.com>
> > > >> > > > >
> > > >> > > > > Issues showed up when I set up a Kali Linux Guest. I
> > > >> > > > > missed the memory configuration before booting up the
> > > >> > > > > instance, so it started with 1GB of memory, and
> > > >> > > > > ballooning active between 512MB and several TB of memory.
> > > >> > > > > Hyper-V started to allocate more and more memory to this
> > > >> > > > > guest since the reported memory requirements also
> > > >> > > > > increased. The guest kernel didn't see any of that allocated
> memory, as far as I can tell.
> >
> > Please do not forget about this: (emoji-pointing-up)
> >
> 
> Hmmm.  Right off the bat, I don't know how to fix this.  Hyper-V tells the
> guest "Here is more memory".  The hv_balloon driver adds the memory (but
> doesn't mark it "online"), and sends a positive ACK to Hyper-V.
> From Hyper-V's standpoint, it has successfully given the memory to the
> guest. But if the guest hasn't onlined the memory and isn't using it, the guest
> continues to report high memory pressure.  Hyper-V assigns yet more
> memory to the guest, still to no effect.  Having the hv_balloon driver delay
> the ACK until the memory comes online is fraught with problems, and of
> course Hyper-V has no visibility into whether the guest has onlined the
> memory.
> 
> This may be one where the guest configuration really must be
> correct.   But I'm open to other suggestions for a possible solution.
> 
> Michael

From checking the drivers code, it looks like the guest tells only the free and committed memory, not the total. I can also see considerations about num_pages_onlined in the committed-calculation.

I see 2 possible options at the moment: Adding num_total to the message (changing the protocol), or stop reporting if the guest fails to online memory after the first increase. A third, more complicated option would be checking for not onlined pages (I've seen functions for that in the code) and adding them to the free value in the report.

I'd love to write a patch for this if I had a clue how to test and debug it without rebuilding my kernel all the time. 

Flo


  reply	other threads:[~2022-06-13 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 15:40 hv_balloon: Only works in ubuntu Florian Müller
2022-06-11 17:36 ` Michael Kelley (LINUX)
2022-06-11 17:58   ` AW: " Florian Müller
2022-06-11 19:30     ` Michael Kelley (LINUX)
2022-06-11 19:44       ` AW: " Florian Müller
2022-06-13  0:56         ` Michael Kelley (LINUX)
2022-06-13  7:58           ` Vitaly Kuznetsov
2022-06-13  8:47             ` David Hildenbrand
2022-06-13  8:53             ` AW: " Florian M?ller
2022-06-13  9:29               ` David Hildenbrand
2022-06-13 14:04               ` Michael Kelley (LINUX)
2022-06-13 14:45                 ` Florian M?ller [this message]
2022-06-14 17:01                   ` Michael Kelley (LINUX)

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=DB3PR0602MB36748AD171E0F1501C7D1898FFAB9@DB3PR0602MB3674.eurprd06.prod.outlook.com \
    --to=max06.net@outlook.com \
    --cc=dhildenb@redhat.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=vkuznets@redhat.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.