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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 3D183C433DF for ; Fri, 15 May 2020 21:12:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ACB3E2065C for ; Fri, 15 May 2020 21:12:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="nxT0Ssf9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACB3E2065C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 22E758E0003; Fri, 15 May 2020 17:12:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B72C8E0001; Fri, 15 May 2020 17:12:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07FDC8E0003; Fri, 15 May 2020 17:12:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id E17BB8E0001 for ; Fri, 15 May 2020 17:12:16 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A94174853 for ; Fri, 15 May 2020 21:12:16 +0000 (UTC) X-FDA: 76820201472.04.sheep57_13cff8088c719 X-HE-Tag: sheep57_13cff8088c719 X-Filterd-Recvd-Size: 4803 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 May 2020 21:12:16 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 658E2205CB; Fri, 15 May 2020 21:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589577135; bh=UmRPGOLdKmuTI3Qv0jzWmP0JQ6FJlc6TDky71yMCXsw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nxT0Ssf9yY8pLVLUEFt5SAsZlyL5o6RvbYcpe/Ogb/hZ+Ibv3VYpsIHopMwIvk69A +v0QRtIwEwpLk0FCwhPrY/meT71ffNnp97a68i1ipAlCz7NidwUH9DVZrUpfKzkMPS TuSlq3nyhe5fsuqvT1isjduKVkMQeXc1Kt6J9V7M= Date: Fri, 15 May 2020 14:12:11 -0700 From: Andrew Morton To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Borislav Petkov , Brian Cain , Catalin Marinas , Chris Zankel , "David S. Miller" , Geert Uytterhoeven , Greentime Hu , Greg Ungerer , Guan Xuetao , Guo Ren , Heiko Carstens , Helge Deller , Ingo Molnar , Ley Foon Tan , Mark Salter , Matthew Wilcox , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Nick Hu , Paul Walmsley , Richard Weinberger , Rich Felker , Russell King , Stafford Horne , Thomas Bogendoerfer , Thomas Gleixner , Tony Luck , Vincent Chen , Vineet Gupta , Will Deacon , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, x86@kernel.org, Mike Rapoport Subject: Re: [PATCH v2 00/12] mm: consolidate definitions of page table accessors Message-Id: <20200515141211.653db07a4e7142107a57cf24@linux-foundation.org> In-Reply-To: <20200514170327.31389-1-rppt@kernel.org> References: <20200514170327.31389-1-rppt@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: On Thu, 14 May 2020 20:03:15 +0300 Mike Rapoport wrote: > The low level page table accessors (pXY_index(), pXY_offset()) are > duplicated across all architectures and sometimes more than once. For > instance, we have 31 definition of pgd_offset() for 25 supported > architectures. > > Most of these definitions are actually identical and typically it boils > down to, e.g. > > static inline unsigned long pmd_index(unsigned long address) > { > return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); > } > > static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) > { > return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); > } > > These definitions can be shared among 90% of the arches provided XYZ_SHIFT, > PTRS_PER_XYZ and xyz_page_vaddr() are defined. > > For architectures that really need a custom version there is always > possibility to override the generic version with the usual ifdefs magic. > > These patches introduce include/linux/pgtable.h that replaces > include/asm-generic/pgtable.h and add the definitions of the page table > accessors to the new header. hm, > 712 files changed, 684 insertions(+), 2021 deletions(-) big! There's a lot of stuff going on at present (I suspect everyone is sitting at home coding up a storm). However this all merged up fairly cleanly, haven't tried compiling it yet.