Messages in this thread | | | Date | Sun, 4 Aug 2013 16:19:28 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH] Add per-process flag to control thp |
| |
On 08/03, Kees Cook wrote: > > On Fri, Aug 2, 2013 at 1:34 PM, Alex Thorlton <athorlton@sgi.com> wrote: > > > >> And I think thp_disabled should be reset to 0 on exec. > > > > The main purpose for this getting carried down from the parent process > > is that we'd like to be able to have a userland program set this flag on > > itself, and then spawn off children who will also carry the flag. > > This allows us to set the flag for programs where we're unable to modify > > the code, thus resolving the issues detailed above. > > This could be done with LD_PRELOAD for uncontrolled binaries. Though > it does seem sensible to make it act like most personality flags do > (i.e. inherited).
It is only inheritable if the process is single-threaded.
And even if it is single-threaded I can't understand how it can really help.
OK, transparent_hugepage_enabled() checks ->thp_disabled, but this is the fault path. But this flag can't hide the task from khugepaged and collapse_huge_page ?
I still think this should be mm flag. And we have MMF_INIT_MASK, it can be inheritable.
Oleg.
| |