From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerald Schaefer Subject: Re: [PATCH 10/10] arch: fix has_transparent_hugepage() Date: Wed, 6 Apr 2016 13:56:59 +0200 Message-ID: <20160406135659.29846d02@thinkpad> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: owner-linux-mm@kvack.org To: Hugh Dickins Cc: Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , Arnd Bergman , Ralf Baechle , Vineet Gupta , Russell King , Will Deacon , Michael Ellerman , "Aneesh Kumar K.V" , Martin Schwidefsky , David Miller , Chris Metcalf , Ingo Molnar , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Tue, 5 Apr 2016 14:02:49 -0700 (PDT) Hugh Dickins wrote: > I've just discovered that the useful-sounding has_transparent_hugepage() > is actually an architecture-dependent minefield: on some arches it only > builds if CONFIG_TRANSPARENT_HUGEPAGE=y, on others it's also there when > not, but on some of those (arm and arm64) it then gives the wrong answer; > and on mips alone it's marked __init, which would crash if called later > (but so far it has not been called later). > > Straighten this out: make it available to all configs, with a sensible > default in asm-generic/pgtable.h, removing its definitions from those > arches (arc, arm, arm64, sparc, tile) which are served by the default, > adding #define has_transparent_hugepage has_transparent_hugepage to those > (mips, powerpc, s390, x86) which need to override the default at runtime, > and removing the __init from mips (but maybe that kind of code should be > avoided after init: set a static variable the first time it's called). > > Signed-off-by: Hugh Dickins > --- Acked-by: Gerald Schaefer # for arch/s390 bits -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:47991 "EHLO e06smtp11.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754746AbcDFL5K (ORCPT ); Wed, 6 Apr 2016 07:57:10 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Apr 2016 12:57:08 +0100 Date: Wed, 6 Apr 2016 13:56:59 +0200 From: Gerald Schaefer Subject: Re: [PATCH 10/10] arch: fix has_transparent_hugepage() Message-ID: <20160406135659.29846d02@thinkpad> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Hugh Dickins Cc: Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , Arnd Bergman , Ralf Baechle , Vineet Gupta , Russell King , Will Deacon , Michael Ellerman , "Aneesh Kumar K.V" , Martin Schwidefsky , David Miller , Chris Metcalf , Ingo Molnar , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Message-ID: <20160406115659.ixn-KPAv5MhMX9DR9k1ahSJkVbhZ0MzzAegS2a-Yskw@z> On Tue, 5 Apr 2016 14:02:49 -0700 (PDT) Hugh Dickins wrote: > I've just discovered that the useful-sounding has_transparent_hugepage() > is actually an architecture-dependent minefield: on some arches it only > builds if CONFIG_TRANSPARENT_HUGEPAGE=y, on others it's also there when > not, but on some of those (arm and arm64) it then gives the wrong answer; > and on mips alone it's marked __init, which would crash if called later > (but so far it has not been called later). > > Straighten this out: make it available to all configs, with a sensible > default in asm-generic/pgtable.h, removing its definitions from those > arches (arc, arm, arm64, sparc, tile) which are served by the default, > adding #define has_transparent_hugepage has_transparent_hugepage to those > (mips, powerpc, s390, x86) which need to override the default at runtime, > and removing the __init from mips (but maybe that kind of code should be > avoided after init: set a static variable the first time it's called). > > Signed-off-by: Hugh Dickins > --- Acked-by: Gerald Schaefer # for arch/s390 bits