From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbdI1IZU (ORCPT ); Thu, 28 Sep 2017 04:25:20 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:32979 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbdI1IZS (ORCPT ); Thu, 28 Sep 2017 04:25:18 -0400 X-Google-Smtp-Source: AOwi7QBg/GWlKSTMrxEfAYEiJVc+uQSeQ+yPa/NLf2hD9Dijnv1EIvMOb34MOf4f+8AIFqbdwODBAw== Date: Thu, 28 Sep 2017 10:25:14 +0200 From: Ingo Molnar To: "Kirill A. Shutemov" Cc: Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv7 09/19] x86/mm: Make MAX_PHYSADDR_BITS and MAX_PHYSMEM_BITS dynamic Message-ID: <20170928082514.tl6tuigmx6oleus6@gmail.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> <20170918105553.27914-10-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170918105553.27914-10-kirill.shutemov@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kirill A. Shutemov wrote: > For boot-time switching between paging modes, we need to be able to > adjust size of physical address space at runtime. > > As part of making physical address space size variable, we have to make > X86_5LEVEL dependent on SPARSEMEM_VMEMMAP. !SPARSEMEM_VMEMMAP > configuration doesn't work well with variable MAX_PHYSMEM_BITS. > > Affect on kernel image size: > > text data bss dec hex filename > 10710340 4880000 860160 16450500 fb03c4 vmlinux.before > 10710666 4880000 860160 16450826 fb050a vmlinux.after > > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/Kconfig | 1 + > arch/x86/include/asm/pgtable_64_types.h | 2 +- > arch/x86/include/asm/sparsemem.h | 9 ++------- > arch/x86/kernel/setup.c | 5 ++--- > 4 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 6a15297140ff..f75723d62c25 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1403,6 +1403,7 @@ config X86_PAE > config X86_5LEVEL > bool "Enable 5-level page tables support" > depends on X86_64 > + depends on SPARSEMEM_VMEMMAP Adding a 'depends on' to random kernel internal implementational details, to support new hardware, sucks as an UI, as it will just randomly hide/show the new hardware option if certain magic Kconfig combinations are set. Please check how other architectures are doing it. (Hint: they are using select.) Also, what is the real dependency here? Why don't the other memory models work, what's the failure mode - won't build, won't boot, or misbehaves in some other way? Thanks, Ingo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id C30AA6B025F for ; Thu, 28 Sep 2017 04:25:18 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id b82so338552wmh.8 for ; Thu, 28 Sep 2017 01:25:18 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id q18sor374938wre.9.2017.09.28.01.25.17 for (Google Transport Security); Thu, 28 Sep 2017 01:25:17 -0700 (PDT) Date: Thu, 28 Sep 2017 10:25:14 +0200 From: Ingo Molnar Subject: Re: [PATCHv7 09/19] x86/mm: Make MAX_PHYSADDR_BITS and MAX_PHYSMEM_BITS dynamic Message-ID: <20170928082514.tl6tuigmx6oleus6@gmail.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> <20170918105553.27914-10-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170918105553.27914-10-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org * Kirill A. Shutemov wrote: > For boot-time switching between paging modes, we need to be able to > adjust size of physical address space at runtime. > > As part of making physical address space size variable, we have to make > X86_5LEVEL dependent on SPARSEMEM_VMEMMAP. !SPARSEMEM_VMEMMAP > configuration doesn't work well with variable MAX_PHYSMEM_BITS. > > Affect on kernel image size: > > text data bss dec hex filename > 10710340 4880000 860160 16450500 fb03c4 vmlinux.before > 10710666 4880000 860160 16450826 fb050a vmlinux.after > > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/Kconfig | 1 + > arch/x86/include/asm/pgtable_64_types.h | 2 +- > arch/x86/include/asm/sparsemem.h | 9 ++------- > arch/x86/kernel/setup.c | 5 ++--- > 4 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 6a15297140ff..f75723d62c25 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1403,6 +1403,7 @@ config X86_PAE > config X86_5LEVEL > bool "Enable 5-level page tables support" > depends on X86_64 > + depends on SPARSEMEM_VMEMMAP Adding a 'depends on' to random kernel internal implementational details, to support new hardware, sucks as an UI, as it will just randomly hide/show the new hardware option if certain magic Kconfig combinations are set. Please check how other architectures are doing it. (Hint: they are using select.) Also, what is the real dependency here? Why don't the other memory models work, what's the failure mode - won't build, won't boot, or misbehaves in some other way? Thanks, Ingo -- 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