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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=ham 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 9F4B6C48BCF for ; Wed, 9 Jun 2021 08:51:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8378D6101A for ; Wed, 9 Jun 2021 08:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237780AbhFIIw5 (ORCPT ); Wed, 9 Jun 2021 04:52:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:45396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237776AbhFIIw4 (ORCPT ); Wed, 9 Jun 2021 04:52:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40D73613B6; Wed, 9 Jun 2021 08:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623228662; bh=8tEls2a/j7rfLxExLeORjJlhhRMMnkNIAM3JBjeBXvQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LQDflmZe8GCGk+yE+6t0jnBhybC3t6u+cv2dwtA8RYnfwgMeo8WJWR4Jrk7+oEHUG +LZhm54B/GRv/+AzBai/pepBRapGN3Yvum4g4htxptOm6Hin60MyrUPSdVoPl6Ima3 63J43iUHA9zvuAOVzdCIYQlNhWzw3VSq+/Y3MZUi2GAooFLzxkS4DSacafOcOctPxH v3FZAF2gvX6Wl9H4lgAvp++2zsKZ0H3xMxhlEZXW8aztVORCBq+5xgkHPoE3/tL15r V7qg8oNM/cWsYEUomz3iFnSd9hjsy2q2Oouc/gWltLvLJigxqi1qzAGUlIn0ABKiLo RVXEJ7ZZn38MQ== Date: Wed, 9 Jun 2021 11:50:48 +0300 From: Mike Rapoport To: Anshuman Khandual Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Nick Hu , Richard Henderson , Vineet Gupta , Catalin Marinas , Will Deacon , Guo Ren , Brian Cain , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Ley Foon Tan , Jonas Bonn , Stefan Kristiansson , Stafford Horne , "James E.J. Bottomley" , Michael Ellerman , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Heiko Carstens , Yoshinori Sato , "David S. Miller" , Jeff Dike , Thomas Gleixner , Chris Zankel , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] mm/thp: Define default pmd_pgtable() Message-ID: References: <1623214799-29817-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623214799-29817-1-git-send-email-anshuman.khandual@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anshuman, On Wed, Jun 09, 2021 at 10:29:59AM +0530, Anshuman Khandual wrote: > Currently most platforms define pmd_pgtable() as pmd_page() duplicating the > same code all over. Instead just define a default value i.e pmd_page() for > pmd_pgtable() and let platforms override when required via . > All the existing platform that override pmd_pgtable() have been moved into > their respective header in order to precede before the new > generic definition. This makes it much cleaner with reduced code. > > Cc: Nick Hu > Cc: Richard Henderson > Cc: Vineet Gupta > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Guo Ren > Cc: Brian Cain > Cc: Geert Uytterhoeven > Cc: Michal Simek > Cc: Thomas Bogendoerfer > Cc: Ley Foon Tan > Cc: Jonas Bonn > Cc: Stefan Kristiansson > Cc: Stafford Horne > Cc: "James E.J. Bottomley" > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc: Paul Walmsley > Cc: Palmer Dabbelt > Cc: Heiko Carstens > Cc: Yoshinori Sato > Cc: "David S. Miller" > Cc: Jeff Dike > Cc: Thomas Gleixner > Cc: Chris Zankel > Cc: Andrew Morton > Cc: linux-arch@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual One nit below, otherwise Acked-by: Mike Rapoport > --- > This patch applies on linux-next (20210608) as there is a merge conflict > dependency on the following commit. > > 40762590e8be ("mm: define default value for FIRST_USER_ADDRESS"). > > This patch has been built tested across multiple platforms. > > Changes in V2: > > - Changed m68k per Geert > > Changes in V1: > > https://lore.kernel.org/linux-arch/1623130327-13325-1-git-send-email-anshuman.khandual@arm.com/ ... > diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h > index 000f64869b91..198036aff519 100644 > --- a/arch/m68k/include/asm/sun3_pgalloc.h > +++ b/arch/m68k/include/asm/sun3_pgalloc.h > @@ -32,7 +32,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page > { > pmd_val(*pmd) = __pa((unsigned long)page_address(page)); > } > -#define pmd_pgtable(pmd) pmd_page(pmd) > > /* > * allocating and freeing a pmd is trivial: the 1-entry pmd is > diff --git a/arch/m68k/include/asm/sun3_pgtable.h b/arch/m68k/include/asm/sun3_pgtable.h > index 5b24283a0a42..127282bd8b96 100644 > --- a/arch/m68k/include/asm/sun3_pgtable.h > +++ b/arch/m68k/include/asm/sun3_pgtable.h > @@ -96,6 +96,8 @@ > > #ifndef __ASSEMBLY__ > > +#define pmd_pgtable(pmd) pmd_page(pmd) > + Is this one really needed? Won't the generic definition work instead? > /* > * Conversion functions: convert a page and protection to a page entry, > * and a page entry and page directory to the page they refer to. > diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h > index d56b9f670ad1..6c33b05f730f 100644 > --- a/arch/microblaze/include/asm/pgalloc.h > +++ b/arch/microblaze/include/asm/pgalloc.h > @@ -28,8 +28,6 @@ static inline pgd_t *get_pgd(void) > > #define pgd_alloc(mm) get_pgd() > > -#define pmd_pgtable(pmd) pmd_page(pmd) > - > extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm); > > #define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte)) -- Sincerely yours, Mike.