Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MADV_HUGEPAGE works with file-mapped memory since Linux 5.4 #120

Open
ruihe774 opened this issue Jun 24, 2024 · 0 comments
Open

MADV_HUGEPAGE works with file-mapped memory since Linux 5.4 #120

ruihe774 opened this issue Jun 24, 2024 · 0 comments

Comments

@ruihe774
Copy link

According to the man page of madvise, MADV_HUGEPAGE works with file-mapped memory since Linux 5.4:

Since Linux 5.4, automatic scan of eligible areas and replacement by huge pages works with private anonymous pages
(see mmap(2)), shmem pages, and file-backed pages. For all memory types, memory may only be replaced by huge
pages on hugepage-aligned boundaries. For file-mapped memory —including tmpfs (see tmpfs(2))— the mapping must
also be naturally hugepage-aligned within the file. Additionally, for file-backed, non-tmpfs memory, the file
must not be open for write and the mapping must be executable.

which contradicts current doc of Advice::HugePage:

/// Enable Transparent Huge Pages (THP) for pages in the range
/// specified by addr and length. Currently, Transparent Huge
/// Pages work only with private anonymous pages (see
/// mmap(2)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant