Commit 9bf96c1
mm: get huge pages for unaligned allocations spanning at least one huge page
When page faults trigger pgalloc.MemoryFile allocation, the size of the
allocation never exceeds one huge page, and if it is exactly one huge page in
size then it will be hugepage-aligned. However, when pgalloc.MemoryFile
allocation is triggered by memory-mapped I/O (e.g. a read() to unfaulted
memory), mmap(MAP_POPULATE), mlock(), or MM.Pin() (due to driver activity), the
allocated range may be hugepage-unaligned but include one or more aligned huge
pages; in these cases, split the allocation into up to three parts for the
sub-hugepage subrange at the beginning, the sub-hugepage subrange at the end,
and the hugepage-aligned subrange in between, so that the hugepage-aligned
subrange can use a hugepage-backed allocation.
PiperOrigin-RevId: 8129616531 parent 76290f4 commit 9bf96c1
1 file changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
286 | 313 | | |
287 | 314 | | |
288 | 315 | | |
| |||
0 commit comments