Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: Anirudh Rayabharam <anirudh@anirudhrb.com>
To: Magnus Kulke <magnuskulke@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Souradeep Chakrabarti <schakrabarti@microsoft.com>,
	Wei Liu <liuwe@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	Magnus Kulke <magnuskulke@microsoft.com>,
	Long Li <longli@microsoft.com>,
	linux-arch@vger.kernel.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Anirudh Rayabharam <Anirudh.Rayabharam@microsoft.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, Wei Liu <wei.liu@kernel.org>
Subject: Re: [PATCH v3] drivers/hv: remove deposited pages from direct map
Date: Mon, 28 Sep 2026 12:44:16 +0000	[thread overview]
Message-ID: <20260928-hopping-illustrious-guppy-d4fd41@anirudhrb> (raw)
In-Reply-To: <arZhqarRnacsApc0@example.com>

On Fri, Sep 25, 2026 at 01:57:29PM +0200, Magnus Kulke wrote:
> On Thu, Sep 24, 2026 at 01:51:10PM +0000, Anirudh Rayabharam wrote:
> > On Thu, Sep 17, 2026 at 10:10:52PM +0200, Magnus Kulke wrote:
> > > +
> > > +	for (i = 0; i < count; ++i) {
> > > +		page = pfn_to_page(pfns[i]);
> > > +		ret = set_direct_map_valid_noflush(page, 1, true);
> > 
> > Should we batch this? (i.e. collect a batch of contiguous PFNs and restore them
> > at once)
> 
> yeah, seems conceivable. let me check.
> 
> > 
> > > +		/*
> > > +		 * HV_DEPOSIT_MAX is capped at 511, so a deposit range cannot cover
> > > +		 * a 2MiB page, so deposited pages are of 4k granularity and cannot
> > > +		 * be collapses into a 2MiB page, which would require an allocation
> > 
> > 511 is the limit for one deposit call. But after multiple deposit calls,
> > a deposited range can cover a 2 MiB page.
> >
> > > +		 * and can potentially fail.
> > 
> > It is unclear to me what requires an allocation and can potentially
> > fail. Could you please clarify?
> > 
> 
> yeah, admittedly this is properly an overly defensive comment. the point
> was: set_direct_map_valid_noflush() is fallible. I understand one of the
> reasons for it to fail would be reoganization of the direct map,
> which would imply allocations, which in turn could fail.
> 
> but this is contrived and should not happen for the deposit case. Also,
> with Mukesh's proposed rework, this comment would not be accurate anymore.
> So, I'd remove the reasoning from the comment (but keep the logic), ack?

Yeah, sounds good!

Thanks,
Anirudh.

> 
> > > +		 *
> > > +		 * Should it fail anyway we leak the page, if we would hand it
> > > +		 * back to the allocator we would introduce faults into random other
> > > +		 * parts.
> > 
> > I agree this is what we should do. I just don't understand what the
> > first part of this comment block is talking about.
> > 
> > Thanks,
> > Anirudh.

  reply	other threads:[~2026-09-28 12:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 20:10 [PATCH v3] drivers/hv: remove deposited pages from direct map Magnus Kulke
2026-09-18  0:23 ` Mukesh R
2026-09-18 10:48   ` Magnus Kulke
2026-09-19 23:16     ` Wei Liu
2026-09-25  0:30     ` Mukesh R
2026-09-25 12:01       ` Magnus Kulke
2026-09-19 23:30 ` Wei Liu
2026-09-24 13:51 ` Anirudh Rayabharam
2026-09-25 11:57   ` Magnus Kulke
2026-09-28 12:44     ` Anirudh Rayabharam [this message]
2026-09-25 16:23 ` Michael Kelley
2026-09-30 11:33   ` Magnus Kulke
2026-10-01  5:10     ` Michael Kelley
2026-10-05 10:49       ` Magnus Kulke

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=20260928-hopping-illustrious-guppy-d4fd41@anirudhrb \
    --to=anirudh@anirudhrb.com \
    --cc=Anirudh.Rayabharam@microsoft.com \
    --cc=arnd@arndb.de \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=longli@microsoft.com \
    --cc=magnuskulke@linux.microsoft.com \
    --cc=magnuskulke@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=schakrabarti@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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