Re: [PATCH 2/3] mm: make the threshold of enabling THP configurable

From: Dave Hansen
Date: Mon Jun 20 2011 - 12:59:55 EST

On Tue, 2011-06-21 at 00:34 +0800, Amerigo Wang wrote:
> + int "The minimal threshold of enabling Transparent Hugepage"
> + range 512 8192
> + default "512"
> + help
> + The threshold of enabling Transparent Huagepage automatically,
> + in Mbytes, below this value, Transparent Hugepage will be disabled
> + by default during boot.

It makes some sense to me that there would _be_ a threshold, simply
because you need some space to defragment things. But, I can't imagine
any kind of user having *ANY* kind of idea what to set this to. Could
we add some text to this? Maybe:

Transparent hugepages are created by moving other pages out of
the way to create large, contiguous swaths of free memory.
However, some memory on a system can not be easily moved. It is
likely on small systems that this unmovable memory will occupy a
large portion of total memory, which makes even attempting to
create transparent hugepages very expensive.

If you are unsure, set this to the smallest possible value.

To override this at boot, use the $FOO boot command-line option.

I'm also not sure putting a ceiling on this makes a lot of sense.
What's the logic behind that? I know it would be a mess to expose it to
users, but shouldn't this be a per-zone limit, logically? Seems like a
8GB system would have similar issues to a two-numa-node 16GB system.

-- Dave

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at