linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Migration/remap question for hugee pages of 2MB
@ 2025-01-21  8:18 Mounesh Badiger
  2025-01-21  8:32 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Mounesh Badiger @ 2025-01-21  8:18 UTC (permalink / raw)
  To: linux-mm

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

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.


-- 
Mounesh Badiger
Support for education
Visit*: www.vidyaposhak.org <http://www.vidyaposhak.org/> *

[-- Attachment #2: Type: text/html, Size: 961 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Migration/remap question for hugee pages of 2MB
  2025-01-21  8:18 Migration/remap question for hugee pages of 2MB Mounesh Badiger
@ 2025-01-21  8:32 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2025-01-21  8:32 UTC (permalink / raw)
  To: Mounesh Badiger, linux-mm

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-21  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-21  8:18 Migration/remap question for hugee pages of 2MB Mounesh Badiger
2025-01-21  8:32 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox