Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
Splitting kernel huge page (THP) returned by alloc_pages()

I am looking for a way to split the kernel's huge page (2MiB) mappings into the smaller (4KiB) page table entries. So far, I only encountered the function set_memory_4k, which only works during the early boot stage (global variable early_boot_irqs_disabled must be true). I am a bit reluctant to disable interrupts to call this function, but I don't know of any other way to split a kernel (not user) page table.

The goal is to map individual 4KB pages with different permissions. However, pages returned via alloc_pages() are often part of 2MB mappings. I do not have an option to use any other allocator (vmalloc, kmalloc, memblock, ...), so I am required to use the alloc_pages() function or any of its variants.

Additional information:

I am aware of the existing function split_huge_page. Unfortunately this approach is not working for struct pages representing kernel memory. The reason for this (according to LWN) is that the page->mapping field, which is checked before the split, needs to be non-NULL. This doesn't apply to kernel pages, so this approach also only seems to work for user space pages.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I'm not sure get your question clearly. I see you need is split_huge_pmd not split_huge_page?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!