]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees
authorPasha Tatashin <pasha.tatashin@soleen.com>
Wed, 12 Apr 2023 19:59:39 +0000 (19:59 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 21 Apr 2023 23:07:57 +0000 (16:07 -0700)
commit0212babb656495755ad4bfeb1066aa5c83efd2fd
tree8d69ffb509fd0f6a0fe21e436c93a67d9415b1d1
parentf9ccad57421dbadaa24b4b83dd3008113426e959
mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees

HugeTLB pages have a struct page optimizations where struct pages for tail
pages are freed.  However, when HugeTLB pages are destroyed, the memory
for struct pages (vmemmap) needs to be allocated again.

Currently, __GFP_NORETRY flag is used to allocate the memory for vmemmap,
but given that this flag makes very little effort to actually reclaim
memory the returning of huge pages back to the system can be problem.
Lets use __GFP_RETRY_MAYFAIL instead.  This flag is also performs graceful
reclaim without causing ooms, but at least it may perform a few retries,
and will fail only when there is genuinely little amount of unused memory
in the system.

Link: https://lkml.kernel.org/r/20230412195939.1242462-1-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Suggested-by: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb_vmemmap.c