From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166010AbdEYXYa (ORCPT ); Thu, 25 May 2017 19:24:30 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:37310 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165995AbdEYXY0 (ORCPT ); Thu, 25 May 2017 19:24:26 -0400 MIME-Version: 1.0 In-Reply-To: <20170525203334.867-1-kirill.shutemov@linux.intel.com> References: <20170525203334.867-1-kirill.shutemov@linux.intel.com> From: Linus Torvalds Date: Thu, 25 May 2017 16:24:24 -0700 X-Google-Sender-Auth: 0EnFo7sCrQsUJQUlogvMICwpXSc Message-ID: Subject: Re: [PATCHv1, RFC 0/8] Boot-time switching between 4- and 5-level paging To: "Kirill A. Shutemov" Cc: Andrew Morton , "the arch/x86 maintainers" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andi Kleen , Dave Hansen , Andy Lutomirski , "linux-arch@vger.kernel.org" , linux-mm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 25, 2017 at 1:33 PM, Kirill A. Shutemov wrote: > Here' my first attempt to bring boot-time between 4- and 5-level paging. > It looks not too terrible to me. I've expected it to be worse. If I read this right, you just made it a global on/off thing. May I suggest possibly a different model entirely? Can you make it a per-mm flag instead? And then we (a) make all kthreads use the 4-level page tables (b) which means that all the init code uses the 4-level page tables (c) which means that all those checks for "start_secondary" etc can just go away, because those all run with 4-level page tables. Or is it just much too expensive to switch between 4-level and 5-level paging at run-time? Linus