From patchwork Sun Dec 1 01:51:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBE18921 for ; Sun, 1 Dec 2019 01:51:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98B942086A for ; Sun, 1 Dec 2019 01:51:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UtJs7prH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98B942086A 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 70BF76B02A2; Sat, 30 Nov 2019 20:51:12 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6BF7A6B02A4; Sat, 30 Nov 2019 20:51:12 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A9FC6B02A5; Sat, 30 Nov 2019 20:51:12 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 426F56B02A2 for ; Sat, 30 Nov 2019 20:51:12 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id EF40440F1 for ; Sun, 1 Dec 2019 01:51:11 +0000 (UTC) X-FDA: 76214894784.13.dress26_a6d458f63e06 X-Spam-Summary: 2,0,0,7df301843f74c870,d41d8cd98f00b204,akpm@linux-foundation.org,:akpm@linux-foundation.org:aneesh.kumar@linux.ibm.com:arnd@arndb.de:kirill.shutemov@linux.intel.com::mm-commits@vger.kernel.org:npiggin@gmail.com:peterz@infradead.org:torvalds@linux-foundation.org:vgupta@synopsys.com:vineet.gupta1@synopsys.com:will@kernel.org,RULES_HIT:41:355:379:800:960:965:966:967:968:973:988:989:1260:1263:1345:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:1801:1978:1981:2194:2196:2199:2200:2393:2525:2559:2563:2682:2685:2693:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4385:4390:4395:4605:5007:6119:6261:6653:6737:7208:7514:7576:7903:7904:8599:8784:9025:9113:9121:9545:10004:10913:11026:11473:11658:11914:12043:12048:12297:12438:12517:12519:12555:12679:12783:12986:13180:13229:13846:14181:14721:14849:21080:21451:21627:21939:30003:30012:30054:30070,0,RBL:error,Cach eIP:none X-HE-Tag: dress26_a6d458f63e06 X-Filterd-Recvd-Size: 4301 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:51:11 +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 8B7922073C; Sun, 1 Dec 2019 01:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165071; bh=n3XN128wYSp2DeTLpenC+GS3TnYwMVjIWyZxyosMMQc=; h=Date:From:To:Subject:From; b=UtJs7prHsw6XQiQmQfM3lhh0BQcsPO3mFh4oIbiKtc2mQrd5/clSHNxK/Thoe7dXD Hlbuson3CFTD676Wgda3KaUqSBZ426UsATJ3cQa3uX1WBC2uj/im9LlsehqiPcGQyI Z0AtrYrVT6c6L0UqDrkEDPDItmNbIusO0c230QCs= Date: Sat, 30 Nov 2019 17:51:10 -0800 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, arnd@arndb.de, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, npiggin@gmail.com, peterz@infradead.org, torvalds@linux-foundation.org, vgupta@synopsys.com, Vineet.Gupta1@synopsys.com, will@kernel.org Subject: [patch 038/158] asm-generic/tlb: stub out pud_free_tlb() if nopud ... Message-ID: <20191201015110.crZ6tJxJL%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 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: From: Vineet Gupta Subject: asm-generic/tlb: stub out pud_free_tlb() if nopud ... ... independent of __ARCH_HAS_4LEVEL_HACK This came up when removing __ARCH_HAS_5LEVEL_HACK for ARC as code bloat. With this patch we see the following code reduction | bloat-o-meter2 vmlinux-B-elide-ARCH_USE_5LEVEL_HACK vmlinux-C-elide-pud_free_tlb | add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-104 (-104) | function old new delta | free_pgd_range 656 552 -104 | Total: Before=4137276, After=4137172, chg -1.000000% Note: The primary change is alternate defintion for pud_free_tlb() but while there also removed empty stubs for __pud_free_tlb, which is anyhow called only from pud_free_tlb() Link: http://lkml.kernel.org/r/20191016162400.14796-3-vgupta@synopsys.com Signed-off-by: Vineet Gupta Acked-by: Kirill A. Shutemov Acked-by: Linus Torvalds Cc: "Aneesh Kumar K . V" Cc: Arnd Bergmann Cc: Nick Piggin Cc: Peter Zijlstra Cc: Will Deacon Signed-off-by: Andrew Morton --- include/asm-generic/4level-fixup.h | 1 - include/asm-generic/pgtable-nopud.h | 2 +- include/asm-generic/tlb.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) --- a/include/asm-generic/4level-fixup.h~asm-generic-tlb-stub-out-pud_free_tlb-if-nopud +++ a/include/asm-generic/4level-fixup.h @@ -30,7 +30,6 @@ #undef pud_free_tlb #define pud_free_tlb(tlb, x, addr) do { } while (0) #define pud_free(mm, x) do { } while (0) -#define __pud_free_tlb(tlb, x, addr) do { } while (0) #undef pud_addr_end #define pud_addr_end(addr, end) (end) --- a/include/asm-generic/pgtable-nopud.h~asm-generic-tlb-stub-out-pud_free_tlb-if-nopud +++ a/include/asm-generic/pgtable-nopud.h @@ -59,7 +59,7 @@ static inline pud_t *pud_offset(p4d_t *p */ #define pud_alloc_one(mm, address) NULL #define pud_free(mm, x) do { } while (0) -#define __pud_free_tlb(tlb, x, a) do { } while (0) +#define pud_free_tlb(tlb, x, a) do { } while (0) #undef pud_addr_end #define pud_addr_end(addr, end) (end) --- a/include/asm-generic/tlb.h~asm-generic-tlb-stub-out-pud_free_tlb-if-nopud +++ a/include/asm-generic/tlb.h @@ -584,7 +584,6 @@ static inline void tlb_end_vma(struct mm } while (0) #endif -#ifndef __ARCH_HAS_4LEVEL_HACK #ifndef pud_free_tlb #define pud_free_tlb(tlb, pudp, address) \ do { \ @@ -594,7 +593,6 @@ static inline void tlb_end_vma(struct mm __pud_free_tlb(tlb, pudp, address); \ } while (0) #endif -#endif #ifndef __ARCH_HAS_5LEVEL_HACK #ifndef p4d_free_tlb