Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753100Ab3HDOZp (ORCPT ); Sun, 4 Aug 2013 10:25:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752891Ab3HDOZo (ORCPT ); Sun, 4 Aug 2013 10:25:44 -0400 Date: Sun, 4 Aug 2013 16:19:28 +0200 From: Oleg Nesterov To: Kees Cook Cc: Alex Thorlton , "Kirill A. Shutemov" , LKML , Ingo Molnar , Peter Zijlstra , Andrew Morton , Mel Gorman , Rik van Riel , Johannes Weiner , "Eric W. Biederman" , Sedat Dilek , Frederic Weisbecker , Dave Jones , Michael Kerrisk , "Paul E. McKenney" , David Howells , Thomas Gleixner , Al Viro , Srikar Dronamraju , Robin Holt Subject: Re: [PATCH] Add per-process flag to control thp Message-ID: <20130804141928.GA17935@redhat.com> References: <20130802194659.GP26476@sgi.com> <20130802201301.A872BE0090@blue.fi.intel.com> <20130802203457.GR26476@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 35 On 08/03, Kees Cook wrote: > > On Fri, Aug 2, 2013 at 1:34 PM, Alex Thorlton 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/