Page MenuHomeFreeBSD

LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY
ClosedPublic

Authored by olce on Jul 11 2025, 6:52 AM.
Tags
None
Referenced Files
F168321067: D51246.id158306.diff
Thu, Aug 27, 3:00 PM
F168270207: D51246.id158397.diff
Thu, Aug 27, 7:31 AM
Unknown Object (File)
Sat, Aug 22, 2:17 PM
Unknown Object (File)
Sat, Aug 22, 6:30 AM
Unknown Object (File)
Tue, Aug 18, 11:29 AM
Unknown Object (File)
Sun, Aug 16, 9:01 PM
Unknown Object (File)
Thu, Aug 13, 1:31 AM
Unknown Object (File)
Tue, Aug 11, 6:58 PM

Details

Summary

Pass VM_ALLOC_NORECLAIM to vm_page_alloc_noobj_contig() so that it
avoids reclaiming (currently, calling vm_reserv_reclaim_contig()).

According to Linux's documentation, GFP_NORETRY should not cause any
"disruptive reclaim". alloc_pages() is called a lot from the amdgpu DRM
driver via ttm_pool_alloc(), which tries to allocate pages of the
highest order first and fallback to lower order pages (as allocating
contiguous physical pages is in fact not a requirement). This process
relies on failing fast, as requested by
GFP_NORETRY. See also related
commit 718d1928f874 ("LinuxKPI: make linux_alloc_pages() honor
__GFP_NORETRY").

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable