Re: [RFC PATCH 2/3] Add tunable to control THP behavior

Rik van Riel
2013-12-12T21:38:49Z

On 12/12/2013 01:00 PM, Alex Thorlton wrote:
> This part of the patch adds a tunable to
> /sys/kernel/mm/transparent_hugepage called threshold. This threshold
> determines how many pages a user must fault in from a single node before
> a temporary compound page is turned into a THP.

> +++ b/mm/huge_memory.c
> @@ -44,6 +44,9 @@ unsigned long transparent_hugepage_flags __read_mostly =
> (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
> (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
>
> +/* default to 1 page threshold for handing out thps; maintains old behavior */
> +static int transparent_hugepage_threshold = 1;

I assume the motivation for writing all this code is that "1"
was not a good value in your tests.

That makes me wonder, why should 1 be the default value with
your patches?

If there is a better value, why should we not use that?

What is the upside of using a better value?

What is the downside?

Is there a value that would to bound the downside, so it
is almost always smaller than the upside?