From: David Hildenbrand <david@redhat.com>
To: Mounesh Badiger <mounesh.b@gmail.com>, linux-mm@kvack.org
Subject: Re: Migration/remap question for hugee pages of 2MB
Date: Tue, 21 Jan 2025 09:32:09 +0100 [thread overview]
Message-ID: <1608b84c-95a3-41c5-93f7-5cf3239fc0b5@redhat.com> (raw)
In-Reply-To: <CAOGU1pwhf1u26AC5d6xTNJJT0uPv-4AVoL8Q7vSc+sAr+Y-bug@mail.gmail.com>
On 21.01.25 09:18, Mounesh Badiger wrote:
> Hi,
Hi,
> Can linux-mm group confirm, if huge pages of size 2MB cannot be migrated
> or remapped when user-space uses them for IO with the bypassing kernel?
> We need to VA->PA intact once it is mapped.
>
> We want to reserve huge pages and map them using hugetlbfs into the
> userspace. Use /proc/<pid>/pagemap to get VA->PA mapping and use PA
> for IO.
A kernel that supports CONFIG_MIGRATION will be able to migrate 2 MiB
hugetlb folios on most architectures (e.g., x86-64). Such migration
might be triggered by CMA allocations or memory offlining.
IIRC, ordinary page compaction should not be migrating 2 MB hugetlb
folios, because they consume a full pageblock and there is, therefore,
no value in trying to compact such pageblocks.
So short answer: they can get migrated, but migration might not happen
frequently.
To block migration, you could long-term pin these pages from getting
migrated either using vmsplice() or iouring fixed buffers. (the latter
is preferred).
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2025-01-21 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 8:18 Mounesh Badiger
2025-01-21 8:32 ` David Hildenbrand [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=1608b84c-95a3-41c5-93f7-5cf3239fc0b5@redhat.com \
--to=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=mounesh.b@gmail.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