Re: [PATCH 1/3] mm: completely disable THP bytransparent_hugepage=never

From: Eric B Munson
Date: Mon Jun 20 2011 - 13:59:13 EST


On Tue, 21 Jun 2011, Cong Wang wrote:

> ä 2011å06æ21æ 01:28, Rik van Riel åé:
> >On 06/20/2011 01:19 PM, Cong Wang wrote:
> >>ä 2011å06æ21æ 01:10, Rik van Riel åé:
> >>>On 06/20/2011 01:07 PM, Cong Wang wrote:
> >>>>ä 2011å06æ21æ 00:58, Mel Gorman åé:
> >>>>>On Tue, Jun 21, 2011 at 12:34:28AM +0800, Amerigo Wang wrote:
> >>>>>>transparent_hugepage=never should mean to disable THP completely,
> >>>>>>otherwise we don't have a way to disable THP completely.
> >>>>>>The design is broken.
> >>>>>>
> >>>>>
> >>>>>I don't get why it's broken. Why would the user be prevented from
> >>>>>enabling it at runtime?
> >>>>>
> >>>>
> >>>>We need to a way to totally disable it, right? Otherwise, when I
> >>>>configure
> >>>>THP in .config, I always have THP initialized even when I pass "=never".
> >>>>
> >>>>For me, if you don't provide such way to disable it, it is not flexible.
> >>>>
> >>>>I meet this problem when I try to disable THP in kdump kernel, there is
> >>>>no user of THP in kdump kernel, THP is a waste for kdump kernel. This is
> >>>>why I need to find a way to totally disable it.
> >>>
> >>>What you have not explained yet is why having THP
> >>>halfway initialized (but not used, and without a
> >>>khugepaged thread) is a problem at all.
> >>>
> >>>Why is it a problem for you?
> >>
> >>It occupies some memory, memory is valuable in kdump kernel (usually
> >>only 128M). :) Since I am sure no one will use it, why do I still need
> >>to initialize it at all?
> >
> >Lets take a look at how much memory your patches end
> >up saving.
> >
> >By bailing out earlier in hugepage_init, you end up
> >saving 3 sysfs objects, one slab cache and a hash
> >table with 1024 pointers. That's a total of maybe
> >10kB of memory on a 64 bit system.
> >
> >I'm not convinced that a 10kB memory reduction is
> >worth the price of never being able to enable
> >transparent hugepages when a system is booted with
> >THP disabled...
> >
>
> Even if it is really 10K, why not save it since it doesn't
> much effort to make this. ;) Not only memory, but also time,
> this could also save a little time to initialize the kernel.
>
> For me, the more serious thing is the logic, there is
> no way to totally disable it as long as I have THP in .config
> currently. This is why I said the design is broken.
>
> Thanks.
>

If memory is this scarce, why not set CONFIG_TRANSPARENT_HUGEPAGE=n and be done
with it? If the config option is enabled, the admin should be able to turn the
functionality back on if desired. If you really don't _ever_ want THP then
disable the config.

Eric

Attachment: signature.asc
Description: Digital signature