Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425Ab3HEPKm (ORCPT ); Mon, 5 Aug 2013 11:10:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23705 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935Ab3HEPKl (ORCPT ); Mon, 5 Aug 2013 11:10:41 -0400 Message-ID: <51FFC020.9040300@redhat.com> Date: Mon, 05 Aug 2013 11:09:20 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Oleg Nesterov CC: Alex Thorlton , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andrew Morton , Mel Gorman , "Kirill A. Shutemov" , Johannes Weiner , "Eric W. Biederman" , Sedat Dilek , Frederic Weisbecker , Dave Jones , Michael Kerrisk , "Paul E. McKenney" , David Howells , Thomas Gleixner , Al Viro , Srikar Dronamraju , Kees Cook , Robin Holt Subject: Re: [PATCHv2] Add per-process flag to control thp References: <20130802205735.GS26476@sgi.com> <20130803170102.GD32568@redhat.com> In-Reply-To: <20130803170102.GD32568@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 31 On 08/03/2013 01:01 PM, Oleg Nesterov wrote: >> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE >> + p->thp_disabled = current->thp_disabled; >> +#endif > > Unneeded. It will be copied by dup_task_struct() automagically. > > But I simply can't understand why this flag is per-thread. It should be > mm flag, no? It has to be per-mm for another reason, too. Think about what were to happen if one process were ptracing a process with the thp_disabled flag, and ended up causing a new anonymous page to be faulted in. With the thp_disabled flag in the task, get_user_pages would end up not seeing the flag, and the task could get a transparent huge page. With the thp_disabled flag in the mm, it would be possible for get_user_pages to easily find the flag, and do the right thing. -- All rights reversed -- 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/