|
|
Log in / Subscribe / Register

Splitting must be entirely logarithmic

Splitting must be entirely logarithmic

Posted May 12, 2026 21:52 UTC (Tue) by willy (subscriber, #9762)
Parent article: Scaling transparent huge pages to 1GB

> Splitting of 1GB THPs is an open question as well, Arif said. The current patch set, when called upon to split such a page, will disassemble it all the way to the PTE level, yielding 262,144 base pages. He is considering only splitting to 512 PMD-level huge pages, then splitting just one of those down to the PTE level. He asked whether that would be an acceptable strategy; relative silence in the room suggested that, at a minimum, there were no real concerns with that idea.

I must have missed or misunderstood this question. Usama has asked it of me before, and I was very clear on my answer, which has not changed. No, this is not acceptable.

Assuming 4k/2M/1G, splitting a 1G down to 511 PMDs, then splitting the last PMD logarithmically means we need to allocate 521 folios. That's too much strain to place on slab. Sure, it's better than 262,144, but it's still too high. Splitting the entire 1GB logarithmically means we need 19 new folios, a far more reasonable number.

The problem is that the MM does not yet handle folios larger than PMD size. But Usama is not the only one who wants folios larger than PMD size, so he should be able to find reviewers (if you review Usama's code, you don't have to write it yourself! Nor do you have to find reviewers for it!)

Trying to dodge fixing this shortcoming in the MM is poor form. This is functionally we need, and somebody has to do it. If Usama wants to land 1GB support, he needs to do it.. Or procrastinate until somebody else does it. But I don't think it's that hard, just fiddly.


to post comments

Splitting must be entirely logarithmic

Posted May 12, 2026 22:22 UTC (Tue) by Paf (subscriber, #91811) [Link] (1 responses)

I’m not an mm developer but can you sketch why it’s any issue at all? Obviously, it’s not trivial, but seen from way outside it seems like it should be.

Splitting must be entirely logarithmic

Posted May 13, 2026 6:29 UTC (Wed) by willy (subscriber, #9762) [Link]

It's actually fairly trivial. We assume that any PMD we find contains the head page of a folio. We also assume the inverse, that if we're creating a PMD that we want it to point to the first 2MB of a folio. It really is a SMOP to fix, it's just finding all the places that make that assumption and testing the result is a pain.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds