linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Jacob Pan <jacob.pan@linux.microsoft.com>
Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
	Dexuan Cui <decui@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
	Michael Kelley <mhklinux@outlook.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Allen Pais <apais@linux.microsoft.com>,
	Michael Frohlich <mfrohlich@microsoft.com>,
	Vikram Sethi <vsethi@nvidia.com>,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: Re: [PATCH v2] hv_balloon: Fallback to generic_online_page() for non-HV hot added mem
Date: Wed, 8 Jan 2025 07:30:34 +0000	[thread overview]
Message-ID: <Z34pmlFwPYwWJS-C@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20250107180918.1053933-1-jacob.pan@linux.microsoft.com>

On Tue, Jan 07, 2025 at 10:09:18AM -0800, Jacob Pan wrote:
> The Hyper-V balloon driver installs a custom callback for handling page
> onlining operations performed by the memory hotplug subsystem. This
> custom callback is global, and overrides the default callback
> (generic_online_page) that Linux otherwise uses. The custom callback
> properly handles memory that is hot-added by the balloon driver as part
> of a Hyper-V hot-add region.
> 
> But memory can also be hot-added directly by a device driver for a vPCI
> device, particularly GPUs. In such a case, the custom callback installed by
> the balloon driver runs, but won't find the page in its hot-add region list
> and doesn't online it, which could cause driver initialization failures.
> 
> Fix this by having the balloon custom callback run generic_online_page()
> when the page isn't part of a Hyper-V hot-add region, thereby doing the
> default Linux behavior. This allows device driver hot-adds to work
> properly. Similar cases are handled the same way in the virtio-mem driver.
> 
> Suggested-by: Vikram Sethi <vsethi@nvidia.com>
> Tested-by: Michael Frohlich <mfrohlich@microsoft.com>
> Reviewed-by: Michael Kelley <mhklinux@outlook.com>
> Signed-off-by: Jacob Pan <jacob.pan@linux.microsoft.com>

Applied to hyperv-next. Thanks!

      reply	other threads:[~2025-01-08  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07 18:09 [PATCH v2] hv_balloon: Fallback to generic_online_page() for non-HV hot added mem Jacob Pan
2025-01-08  7:30 ` Wei Liu [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=Z34pmlFwPYwWJS-C@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=apais@linux.microsoft.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=jacob.pan@linux.microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfrohlich@microsoft.com \
    --cc=mhklinux@outlook.com \
    --cc=vsethi@nvidia.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).