HomeFreeBSD

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

Description

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

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").

Reviewed by: jeffpc_josefsipek.net, bz
MFC after: 10 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51246

(cherry picked from commit 4ca9190251bbd00c928a3cba54712c3ec25e9e26)

Forgotten on commit to main/-CURRENT:
PR: 277476

Details

Provenance
olceAuthored on Jul 7 2025, 12:27 PM
Reviewer
jeffpc_josefsipek.net
Differential Revision
D51246: LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY
Parents
rG38cf4580a449: Obsoletefiles.inc: Add architecture-specific 'runq.h' headers
Branches
Unknown
Tags
Unknown