From patchwork Sun Dec 1 01:51:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268255 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 3A003921 for ; Sun, 1 Dec 2019 01:51:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 06BB92073C for ; Sun, 1 Dec 2019 01:51:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JSyge2pL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06BB92073C 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 B790F6B02A4; Sat, 30 Nov 2019 20:51:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B286C6B02A6; Sat, 30 Nov 2019 20:51:15 -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 A3ED46B02A7; Sat, 30 Nov 2019 20:51:15 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id 8AF1C6B02A4 for ; Sat, 30 Nov 2019 20:51:15 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 3902140DD for ; Sun, 1 Dec 2019 01:51:15 +0000 (UTC) X-FDA: 76214894910.02.smash91_ae92cbf47524 X-Spam-Summary: 2,0,0,d5232544a0b056c1,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: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:13846:14181:14721:14849:21080:21451:21611:21627:21939:30003:30012:30054,0,RBL:error,CacheIP:none,Bayesian :0.5,0.5 X-HE-Tag: smash91_ae92cbf47524 X-Filterd-Recvd-Size: 4119 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:51:14 +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 D5E38206F0; Sun, 1 Dec 2019 01:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165074; bh=BLW52AgT78+G0osewpmmQ4znGH+hK5/pwnU/Lx/9ynU=; h=Date:From:To:Subject:From; b=JSyge2pLAIKuOpkIdX57n560o8dbzm9MCYqTjgZMinC/XDf2vbt/MeyslTOsJX6Ts JlILvz5ciEqO/XWoT2q7zC+VODnuOAjHOc3QomswAV2n1aF58qgxIoAY/N5bnq48yx 9gmJ83wJLx7g8HuHtvWB+ZLlPciId1pQWaSSS8Z4= Date: Sat, 30 Nov 2019 17:51:13 -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 039/158] asm-generic/tlb: stub out p4d_free_tlb() if nop4d ... Message-ID: <20191201015113.4sakLx4B5%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 p4d_free_tlb() if nop4d ... ... independent of __ARCH_HAS_5LEVEL_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-C-elide-pud_free_tlb vmlinux-D-elide-p4d_free_tlb | add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-104 (-104) | function old new delta | free_pgd_range 552 422 -130 | Total: Before=4137172, After=4137042, chg -1.000000% Link: http://lkml.kernel.org/r/20191016162400.14796-4-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/5level-fixup.h | 1 - include/asm-generic/pgtable-nop4d.h | 2 +- include/asm-generic/tlb.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) --- a/include/asm-generic/5level-fixup.h~asm-generic-tlb-stub-out-p4d_free_tlb-if-nop4d +++ a/include/asm-generic/5level-fixup.h @@ -51,7 +51,6 @@ static inline int p4d_present(p4d_t p4d) #undef p4d_free_tlb #define p4d_free_tlb(tlb, x, addr) do { } while (0) #define p4d_free(mm, x) do { } while (0) -#define __p4d_free_tlb(tlb, x, addr) do { } while (0) #undef p4d_addr_end #define p4d_addr_end(addr, end) (end) --- a/include/asm-generic/pgtable-nop4d.h~asm-generic-tlb-stub-out-p4d_free_tlb-if-nop4d +++ a/include/asm-generic/pgtable-nop4d.h @@ -50,7 +50,7 @@ static inline p4d_t *p4d_offset(pgd_t *p */ #define p4d_alloc_one(mm, address) NULL #define p4d_free(mm, x) do { } while (0) -#define __p4d_free_tlb(tlb, x, a) do { } while (0) +#define p4d_free_tlb(tlb, x, a) do { } while (0) #undef p4d_addr_end #define p4d_addr_end(addr, end) (end) --- a/include/asm-generic/tlb.h~asm-generic-tlb-stub-out-p4d_free_tlb-if-nop4d +++ a/include/asm-generic/tlb.h @@ -594,7 +594,6 @@ static inline void tlb_end_vma(struct mm } while (0) #endif -#ifndef __ARCH_HAS_5LEVEL_HACK #ifndef p4d_free_tlb #define p4d_free_tlb(tlb, pudp, address) \ do { \ @@ -603,7 +602,6 @@ static inline void tlb_end_vma(struct mm __p4d_free_tlb(tlb, pudp, address); \ } while (0) #endif -#endif #endif /* CONFIG_MMU */