From: Magnus Kulke <magnuskulke@linux.microsoft.com>
To: Anirudh Rayabharam <anirudh@anirudhrb.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: Fri, 25 Sep 2026 13:57:29 +0200 [thread overview]
Message-ID: <arZhqarRnacsApc0@example.com> (raw)
In-Reply-To: <20260924-outrageous-nebulous-spaniel-7bf6f7@anirudhrb>
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?
> > + *
> > + * 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.
prev parent reply other threads:[~2026-09-25 11:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 20:10 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 [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=arZhqarRnacsApc0@example.com \
--to=magnuskulke@linux.microsoft.com \
--cc=Anirudh.Rayabharam@microsoft.com \
--cc=anirudh@anirudhrb.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@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
all inboxes | Powered by JetHome®