|
|
Subscribe / Log in / New account

Triggering huge-page collapse from user space

Triggering huge-page collapse from user space

Posted Mar 18, 2022 15:27 UTC (Fri) by zokeefe (subscriber, #140292)
Parent article: Triggering huge-page collapse from user space

Thanks for the kind writeup! :)

> This call will attempt to collapse length bytes of memory beginning at begin into huge pages. There does not appear to be any specific alignment requirement for those parameters, even though huge pages do have alignment requirements.

I should call out what happens when parameters are passed that don't align with architecture hugepage size/alignment; thanks for pointing out that I didn't mention this anywhere.

> If begin points to a base page in the middle of the address range that the huge page containing it will cover, then pages before begin will become part of the result. In other words, begin will be aligned backward to the proper beginning address for the containing huge page. The same is true for length, which will be increased if necessary to encompass a full huge page."

A small correction: the opposite actually happens; we forward align the start and backward align the end. Else, we'd have to make a decision on what to do if the new range fell outside the VMA(s). IOW, we clamp the provided range(s) to be hugepage aligned/sized.


to post comments


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