Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3663118ybv; Sun, 16 Feb 2020 02:46:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwCemtdJAVKFGnteeOnnZ4Fnma4aS0Su9EdeEweT/yrH3H7LsecBcqQlT4JvecPBCsLiQ7K X-Received: by 2002:aca:f44a:: with SMTP id s71mr7025506oih.7.1581849992623; Sun, 16 Feb 2020 02:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581849992; cv=none; d=google.com; s=arc-20160816; b=RnVrIo5qhIWHKmUxjwAG1BroeCLdpzsHrDAMk58mwUnPjYmeAX6TT5k3iWazs1QJMY V9iy0XIVJshA5PSUMjH8ADilQomThMJigL8xLnOXkzSCYQz2gQEVL4Ax3ODE5vc0Rsi6 tlKtiyDCeyjqa5gy1l62e05BKRsxGpSyIAzXFlbQq2t0Uyoz0noV0I8f00LaOAI78e/Z GMjEm5rqcERg+LZZqIhVg7Tn3KCjeDJkZ+pkPsz+koNnkDzDv/esCQ1HM2WkoPvmKeVZ qsDtI89LKHjmQq+Vf4VzonqV/Fh3OagY/iLDYwk3oIA5oQ4W1Z/rb0/m7skKH+HDcnbt CQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=puEVphfmlLbrWTO3mdDB17WkluHf49q+nkCLHU1WEPk=; b=mFkebBQu3nSWK/5wcptuc9lsCH2q+fhKQTorsU3JQJ7yNuto1wjzWu8Sl2TAB37+Cr XT3RvL8r8FOOFLu/ag16SNygdRx1GMOFlrfF8fcT0mqatUNPsGXFqJeM9CNCwb1fQ0Zn 7hGSIUbkXnxarO54F4iITBuUkNfG4Iba7SohwoDzq7OQqEushaFJCU/vM4b6xTlY7xZb lYyc261JNNyYILuYSSrO6v5f1kQ9RFpI8Cy414xBV8biXnzt2AfqAu80LzEx03Q9n/Uj qdIM4lHZG09iFM82egUFmaxjM04JqBwWCBDPymDg7YJgPoomxC/mI0NdKGviOWsd8Rvr 9jmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=RMQrDTHX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si5276968otc.308.2020.02.16.02.46.20; Sun, 16 Feb 2020 02:46:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=RMQrDTHX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727896AbgBPKqP (ORCPT + 99 others); Sun, 16 Feb 2020 05:46:15 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:16289 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbgBPKqO (ORCPT ); Sun, 16 Feb 2020 05:46:14 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48L3gh69Lpz9tyMB; Sun, 16 Feb 2020 11:46:08 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=RMQrDTHX; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 0F5rpVhkSbpS; Sun, 16 Feb 2020 11:46:08 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48L3gh3dBjz9tyM9; Sun, 16 Feb 2020 11:46:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1581849968; bh=puEVphfmlLbrWTO3mdDB17WkluHf49q+nkCLHU1WEPk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RMQrDTHXiSIvSNdSJIUAuTLTwTBfKbldAHrwtZjJ0BW+ZG7c0EUq537f7BNPK+LIN e+qzSqPhQUdW5m9f0ovUN5sc2R9fpgjJRx6JMSfOyIGDK3OikFgbqf4WNmfnjBWb14 Yj8xq1+79SXISvpVp+Jg6Y8NZ4c+QrYGyIAwuT0U= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 63ADD8B784; Sun, 16 Feb 2020 11:46:10 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id GYiIMEW0V5j7; Sun, 16 Feb 2020 11:46:10 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 992958B755; Sun, 16 Feb 2020 11:45:59 +0100 (CET) Subject: Re: [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK To: Russell King - ARM Linux admin , Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Brian Cain , Catalin Marinas , Fenghua Yu , Geert Uytterhoeven , Guan Xuetao , James Morse , Jonas Bonn , Julien Thierry , Ley Foon Tan , Marc Zyngier , Michael Ellerman , Paul Mackerras , Rich Felker , Stafford Horne , Stefan Kristiansson , Suzuki K Poulose , Tony Luck , Will Deacon , Yoshinori Sato , kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, uclinux-h8-devel@lists.sourceforge.jp, Mike Rapoport References: <20200216081843.28670-1-rppt@kernel.org> <20200216082230.GV25745@shell.armlinux.org.uk> From: Christophe Leroy Message-ID: Date: Sun, 16 Feb 2020 11:45:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200216082230.GV25745@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 16/02/2020 à 09:22, Russell King - ARM Linux admin a écrit : > On Sun, Feb 16, 2020 at 10:18:30AM +0200, Mike Rapoport wrote: >> From: Mike Rapoport >> >> Hi, >> >> These patches convert several architectures to use page table folding and >> remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h. >> >> The changes are mostly about mechanical replacement of pgd accessors with p4d >> ones and the addition of higher levels to page table traversals. >> >> All the patches were sent separately to the respective arch lists and >> maintainers hence the "v2" prefix. > > You fail to explain why this change which adds 488 additional lines of > code is desirable. > The purpose of the series, ie droping a HACK, is worth it. However looking at the powerpc patch I have the feeling that this series goes behind its purpose. The number additional lines could be deeply reduced I think if we limit the patches to the strict minimum, ie just do things like below instead of adding lots of handling of useless levels. Instead of doing things like: - pud = NULL; + p4d = NULL; if (pgd_present(*pgd)) - pud = pud_offset(pgd, gpa); + p4d = p4d_offset(pgd, gpa); + else + new_p4d = p4d_alloc_one(kvm->mm, gpa); + + pud = NULL; + if (p4d_present(*p4d)) + pud = pud_offset(p4d, gpa); else new_pud = pud_alloc_one(kvm->mm, gpa); It could be limited to: if (pgd_present(*pgd)) - pud = pud_offset(pgd, gpa); + pud = pud_offset(p4d_offset(pgd, gpa), gpa); else new_pud = pud_alloc_one(kvm->mm, gpa); Christophe