From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954AbdHUPXW (ORCPT ); Mon, 21 Aug 2017 11:23:22 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34928 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753433AbdHUPXS (ORCPT ); Mon, 21 Aug 2017 11:23:18 -0400 Date: Mon, 21 Aug 2017 18:23:09 +0300 From: "Kirill A. Shutemov" To: Ingo Molnar Cc: "Kirill A. Shutemov" , Linus Torvalds , Andrew Morton , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andi Kleen , Dave Hansen , Andy Lutomirski , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv4 08/14] x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable Message-ID: <20170821152309.c4upa6rokozynjti@node.shutemov.name> References: <20170808125415.78842-1-kirill.shutemov@linux.intel.com> <20170808125415.78842-9-kirill.shutemov@linux.intel.com> <20170817090038.lfhmuk7hpuw2zzwo@gmail.com> <20170817105418.gpcxazmpmx4aaxyz@node.shutemov.name> <20170817111005.asebivpywpeyevfq@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170817111005.asebivpywpeyevfq@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 17, 2017 at 01:10:05PM +0200, Ingo Molnar wrote: > > * Kirill A. Shutemov wrote: > > > On Thu, Aug 17, 2017 at 11:00:38AM +0200, Ingo Molnar wrote: > > > > > > * Kirill A. Shutemov wrote: > > > > > > > For boot-time switching between 4- and 5-level paging we need to be able > > > > to fold p4d page table level at runtime. It requires variable > > > > PGDIR_SHIFT and PTRS_PER_P4D. > > > > > > > > Signed-off-by: Kirill A. Shutemov > > > > --- > > > > arch/x86/boot/compressed/kaslr.c | 5 +++++ > > > > arch/x86/include/asm/pgtable_32.h | 2 ++ > > > > arch/x86/include/asm/pgtable_32_types.h | 2 ++ > > > > arch/x86/include/asm/pgtable_64_types.h | 15 +++++++++++++-- > > > > arch/x86/kernel/head64.c | 9 ++++++++- > > > > arch/x86/mm/dump_pagetables.c | 12 +++++------- > > > > arch/x86/mm/init_64.c | 2 +- > > > > arch/x86/mm/kasan_init_64.c | 2 +- > > > > arch/x86/platform/efi/efi_64.c | 4 ++-- > > > > include/asm-generic/5level-fixup.h | 1 + > > > > include/asm-generic/pgtable-nop4d.h | 1 + > > > > include/linux/kasan.h | 2 +- > > > > mm/kasan/kasan_init.c | 2 +- > > > > 13 files changed, 43 insertions(+), 16 deletions(-) > > > > > > So I'm wondering what the code generation effect of this is - what's the > > > before/after vmlinux size? > > > > > > My guess is that the effect should be very small, as these constants are not > > > widely used - but I'm only guessing and could be wrong. > > > > This change increase vmlinux size for defconfig + X86_5LEVEL=y by ~4k or > > 0.01%. > > Please add this info to one of the changelogs. > > BTW., some of that might be won back via the later optimizations, right? Sorry, but no. Just chacked. Introducing alternatives increases .text segment size by about 4k. -- Kirill A. Shutemov