From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDF96C2BA83 for ; Sun, 16 Feb 2020 10:46:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7365B206E2 for ; Sun, 16 Feb 2020 10:46:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="RMQrDTHX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7365B206E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E2F6E6B0003; Sun, 16 Feb 2020 05:46:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE0826B0006; Sun, 16 Feb 2020 05:46:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA76A6B0007; Sun, 16 Feb 2020 05:46:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id B33D76B0003 for ; Sun, 16 Feb 2020 05:46:14 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 37468180AD802 for ; Sun, 16 Feb 2020 10:46:14 +0000 (UTC) X-FDA: 76495660668.10.sea25_8db1683897c3f X-HE-Tag: sea25_8db1683897c3f X-Filterd-Recvd-Size: 5504 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Sun, 16 Feb 2020 10:46:13 +0000 (UTC) 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: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Le 16/02/2020 =C3=A0 09:22, Russell King - ARM Linux admin a =C3=A9crit=C2= =A0: > 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-fi= xup.h. >> >> The changes are mostly about mechanical replacement of pgd accessors w= ith 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. >=20 > You fail to explain why this change which adds 488 additional lines of > code is desirable. >=20 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=20 goes behind its purpose. The number additional lines could be deeply reduced I think if we limit=20 the patches to the strict minimum, ie just do things like below instead=20 of adding lots of handling of useless levels. Instead of doing things like: - pud =3D NULL; + p4d =3D NULL; if (pgd_present(*pgd)) - pud =3D pud_offset(pgd, gpa); + p4d =3D p4d_offset(pgd, gpa); + else + new_p4d =3D p4d_alloc_one(kvm->mm, gpa); + + pud =3D NULL; + if (p4d_present(*p4d)) + pud =3D pud_offset(p4d, gpa); else new_pud =3D pud_alloc_one(kvm->mm, gpa); It could be limited to: if (pgd_present(*pgd)) - pud =3D pud_offset(pgd, gpa); + pud =3D pud_offset(p4d_offset(pgd, gpa), gpa); else new_pud =3D pud_alloc_one(kvm->mm, gpa); Christophe