Re: [PATCH v3] mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice
From: Andrew Morton
Date: Fri Sep 09 2022 - 18:25:51 EST
On Fri, 9 Sep 2022 10:16:53 +0800 Liu Shixin <liushixin2@xxxxxxxxxx> wrote:
> Since user who read THP_ZERO_PAGE_ALLOC may be more concerned about the
> huge zero pages that are really allocated using for thp and can indicated
> the times of calling huge_zero_page_shrinker. It is misleading to increase
> twice if two threads call get_huge_zero_page concurrently. Don't increase
> the value if the huge page is not really used.
>
I cant say I really understand the point about
huge_zero_page_shrinker(), so I propose this changelog:
: A user who reads THP_ZERO_PAGE_ALLOC may be more concerned about the huge
: zero pages that are really allocated for thp. It is misleading to
: increase THP_ZERO_PAGE_ALLOC twice if two threads call get_huge_zero_page
: concurrently. Don't increase the value if the huge page is not really
: used.
The patch makes sense to me. What do others think?