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 00C53C55185 for ; Sun, 26 Apr 2020 00:55:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B48D620748 for ; Sun, 26 Apr 2020 00:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KGoB2SAd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="voeClhtC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B48D620748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To: Message-Id:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o8u2m1SV4IFQ3TWSpimjDw5o2T/0iI3EwWd5S6sbxP0=; b=KGoB2SAdWEU6u+ w31qlv1zGuuLfAS3BDKNMZkQR3Fa2tIshu6W1PJh77HJbxLSrjEdFoNKnbmF+ogLW4t8HSUtQx0h1 i03GyZ4YyDdIupl3+sH/FdiG67OJgyKM68F1dodNx50ay27QD9fLHvlDyjjbyUDa0GLNnpmJB2clU tQtLBKYJMr3xFAy0JifFgiEWJkETDu7fFRxqF0ojGkl4e8nQ4X13N3TXxh8CxVobCu1SyfuqXi2wP 2Pckwb/S2tYBgejJn6mFs0of6TTYLweMzx0rows5V6H5RFzfCPrUDTUnMUTp+uCmv8S0CT5HzS+l4 wCJVSoz48PLnHJUWjIXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSVZw-000176-Kt; Sun, 26 Apr 2020 00:55:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSVZk-0000y2-4R; Sun, 26 Apr 2020 00:55:20 +0000 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 C703C2071E; Sun, 26 Apr 2020 00:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587862513; bh=ZTYhefWcWVPvzKpJ4YNus3Eb/Cw6yBZoMC0HC9f2uJo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=voeClhtCC2L3aoOg4PLujYogg49GIS1fgtfMUKWlqAW9bpZ8ridgihF1PL3jGpRdR Xi9LT36ek6mAp6Z7afYDRNR9CU1fvJtyqQXg8uhWkXxPbyQDCDYWBUE03myUQQA0+B pXuuMUykxqMmru798W+FA08pw+vvgALEiW+OZCd4= Date: Sat, 25 Apr 2020 17:55:11 -0700 From: Andrew Morton To: Anshuman Khandual Subject: Re: [PATCH 3/3] mm/hugetlb: Introduce HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS Message-Id: <20200425175511.7a68efb5e2f4436fe0328c1d@linux-foundation.org> In-Reply-To: <1586864670-21799-4-git-send-email-anshuman.khandual@arm.com> References: <1586864670-21799-1-git-send-email-anshuman.khandual@arm.com> <1586864670-21799-4-git-send-email-anshuman.khandual@arm.com> 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200425_175516_223591_B41ED5EB X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Catalin Marinas , Heiko Carstens , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-mm@kvack.org, Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , Michael Ellerman , Helge Deller , x86@kernel.org, Russell King , Christian Borntraeger , Ingo Molnar , Benjamin Herrenschmidt , Fenghua Yu , Vasily Gorbik , Thomas Bogendoerfer , Borislav Petkov , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tony Luck , linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, Palmer Dabbelt , linuxppc-dev@lists.ozlabs.org, "David S. Miller" , Mike Kravetz Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, 14 Apr 2020 17:14:30 +0530 Anshuman Khandual wrote: > There are multiple similar definitions for arch_clear_hugepage_flags() on > various platforms. This introduces HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS for those > platforms that need to define their own arch_clear_hugepage_flags() while > also providing a generic fallback definition for others to use. This help > reduce code duplication. > > ... > > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -544,6 +544,10 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, > } > #endif > > +#ifndef HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS > +static inline void arch_clear_hugepage_flags(struct page *page) { } > +#endif > + > #ifndef arch_make_huge_pte > static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, > struct page *page, int writable) This is the rather old-school way of doing it. The Linus-suggested way is #ifndef arch_clear_hugepage_flags static inline void arch_clear_hugepage_flags(struct page *page) { } #define arch_clear_hugepage_flags arch_clear_hugepage_flags #endif And the various arch headers do static inline void arch_clear_hugepage_flags(struct page *page) { } #define arch_clear_hugepage_flags arch_clear_hugepage_flags It's a small difference - mainly to avoid adding two variables to the overall namespace where one would do.