Re: [rfc] mm, hugetlb: allow hugepage allocations to excessively reclaim

From: Mike Kravetz
Date: Mon Oct 07 2019 - 18:17:55 EST


On 10/4/19 11:02 AM, David Rientjes wrote:
> On Fri, 4 Oct 2019, Michal Hocko wrote:
>
>> Requesting the userspace to drop _all_ page cache in order allocate a
>> number of hugetlb pages or any other affected __GFP_RETRY_MAYFAIL
>> requests is simply not reasonable IMHO.
>
> It can be used as a fallback when writing to nr_hugepages and the amount
> allocated did not match expectation. Again, I'll defer all of this to
> Mike when he returns: he expressed his preference, I suggested an
> alternative to consider, and he can make the decision to ack or nack this
> patch because he has a better understanding of that expectation from users
> who use hugetlb pages.

I believe these modifications to commit b39d0ee2632d are absolutely necessary
to maintain expected hugetlbfs functionality. Michal's simple test in the
rewritten commit message shows the type of regressions that I expect some
hugetlbfs users to experience. The expectation today is that the kernel will
try hard to allocate the requested number of hugetlb pages. These pages are
often used for very long running processes. Therefore, the tradeoff of more
reclaim (and compaction) activity up front to create the pages is generally
acceptable.

My apologies if the 'testing' I did in [1] was taken as an endorsement of
b39d0ee2632d working well with hugetlbfs. It was a limited test that I knew
did not cover all cases. Therefore, I suggested that if b39d0ee2632d went
forward there should be an exception for __GFP_RETRY_MAYFAIL requests.

[1] https://lkml.kernel.org/r/3468b605-a3a9-6978-9699-57c52a90bd7e@xxxxxxxxxx
--
Mike Kravetz