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 45821C4BA0E for ; Wed, 26 Feb 2020 11:21:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05ADD24656 for ; Wed, 26 Feb 2020 11:21:07 +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="dcbZx4t5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05ADD24656 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 8D4706B0006; Wed, 26 Feb 2020 06:21:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 884666B0007; Wed, 26 Feb 2020 06:21:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7727C6B0008; Wed, 26 Feb 2020 06:21:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id 5D8586B0006 for ; Wed, 26 Feb 2020 06:21:07 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0C0321F06 for ; Wed, 26 Feb 2020 11:21:07 +0000 (UTC) X-FDA: 76532036574.16.crow43_9a57c2d88461 X-HE-Tag: crow43_9a57c2d88461 X-Filterd-Recvd-Size: 5858 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 11:21:06 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48SCzM1tTVz9tyML; Wed, 26 Feb 2020 12:21:03 +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=dcbZx4t5; 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 J7zfGGKBixz2; Wed, 26 Feb 2020 12:21:03 +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 48SCzL6n6pz9tyLT; Wed, 26 Feb 2020 12:21:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582716063; bh=u+44lvk1l0rvN0rVt0XeRLZF9pAnZ+SeTYsCRW90jUs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dcbZx4t5T2TqZBsmJqeETgOslZL/sjGjY3jtgZjyAkWRnWp+cZWdaA9+1CVcQnyrg EAK/r3fzS6yjM9r4KrQXdxQ3U95U+v+IizkroXw9QSoxVs+Y7bA5gjhV+iBVeI3LhD 1eV+B927JsHKM6Lu+qpoDnmZLHfscXCGj3HKorDY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 166CF8B844; Wed, 26 Feb 2020 12:21:04 +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 HTbfYZhVV_tY; Wed, 26 Feb 2020 12:21:03 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B0DBC8B776; Wed, 26 Feb 2020 12:21:01 +0100 (CET) Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables To: 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 , Russell King , 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> <20200216081843.28670-8-rppt@kernel.org> <20200218105440.GA1698@hump> <20200226091315.GA11803@hump> <20200226105615.GB11803@hump> From: Christophe Leroy Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> Date: Wed, 26 Feb 2020 12:20:49 +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: <20200226105615.GB11803@hump> 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 26/02/2020 =C3=A0 11:56, Mike Rapoport a =C3=A9crit=C2=A0: > On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote: >> >> >> Le 26/02/2020 =C3=A0 10:13, Mike Rapoport a =C3=A9crit=C2=A0: >>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote: >>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote: >>>>> >>>>> >>>>> Le 16/02/2020 =C3=A0 09:18, Mike Rapoport a =C3=A9crit=C2=A0: >>>>>> From: Mike Rapoport >>>>>> >>>>>> Implement primitives necessary for the 4th level folding, add walk= s of p4d >>>>>> level where appropriate and replace 5level-fixup.h with pgtable-no= p4d.h. >>>>> >>>>> I don't think it is worth adding all this additionnals walks of p4d= , this >>>>> patch could be limited to changes like: >>>>> >>>>> - pud =3D pud_offset(pgd, gpa); >>>>> + pud =3D pud_offset(p4d_offset(pgd, gpa), gpa); >>>>> >>>>> The additionnal walks should be added through another patch the day= powerpc >>>>> need them. >>>> >>>> Ok, I'll update the patch to reduce walking the p4d. >>> >>> Here's what I have with more direct acceses from pgd to pud. >> >> I went quickly through. This looks promising. >> >> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ? >> Can't we just do >> >> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st) >> addr =3D KERN_VIRT_START + i * PGDIR_SIZE; >> if (!pgd_none(*pgd)) >> /* pgd exists */ >> - walk_pud(st, pgd, addr); >> + walk_pud(st, p4d_offset(pgd, addr), addr); >=20 > We can do >=20 > addr =3D KERN_VIRT_START + i * PGDIR_SIZE; > p4d =3D p4d_offset(pgd, addr); > if (!p4d_none(*pgd)) > walk_pud() >=20 > But I don't think this is really essential. Again, we are trading off c= ode > consistency vs line count. I don't think line count is that important. Ok. Christophe