From patchwork Sun Dec 1 01:51:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268257 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 A01CB112B for ; Sun, 1 Dec 2019 01:51:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6351B206F0 for ; Sun, 1 Dec 2019 01:51:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="a0DZ/QBU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6351B206F0 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 07B9F6B02A6; Sat, 30 Nov 2019 20:51:19 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 02F1C6B02A8; Sat, 30 Nov 2019 20:51:18 -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 E84206B02A9; Sat, 30 Nov 2019 20:51:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id D06266B02A6 for ; Sat, 30 Nov 2019 20:51:18 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 8736982499A8 for ; Sun, 1 Dec 2019 01:51:18 +0000 (UTC) X-FDA: 76214895036.20.meal48_b637481b222e X-Spam-Summary: 2,0,0,c50538c8e73da046,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:1541: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:3352:3865:3867:3868:3870:3871:3874: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:9025:9113:9121:9545:10004:10913:11026:11473:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12679:12783:12986:13069:13180:13223:13229:13311:13357:13846:14181:14384:14581:14721:14777:14849:21080: 21451:21 X-HE-Tag: meal48_b637481b222e X-Filterd-Recvd-Size: 3231 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:51:18 +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 1384B208E4; Sun, 1 Dec 2019 01:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165077; bh=EXWI8BKrEfmXJcJx0HqZC2HE4TaIKMbc/zYRhrwY/yk=; h=Date:From:To:Subject:From; b=a0DZ/QBU9NwmiKHNso7ZRww/x1LSXZ4DMEZtGkJ/GRu7ZYRsMO4h/EdrLpxdDaMbZ a6pVku4plcj8J4B53eW88hcVTnGSFYHZx4qaZlDu9N5XNQ3DRvOdMRqBuwp3RcC7/b N2Y7Zr/MSORIZS33WmDjuudjbnrVEiAdSJnIuUy4= Date: Sat, 30 Nov 2019 17:51:16 -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 040/158] asm-generic/tlb: stub out pmd_free_tlb() if nopmd Message-ID: <20191201015116.wee7OfhTE%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 pmd_free_tlb() if nopmd 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-E-elide-p?d_clear_bad vmlinux-F-elide-pmd_free_tlb | add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-112 (-112) | function old new delta | free_pgd_range 422 310 -112 | Total: Before=4137042, After=4136930, chg -1.000000% Note that pmd folding can be tricky: In 2-level setup (where pmd is conceptually folded) most pmd routines are valid and refer to upper levels. In this patch we can, but see next patch for example where we can't Link: http://lkml.kernel.org/r/20191016162400.14796-5-vgupta@synopsys.com Signed-off-by: Vineet Gupta Acked-by: Kirill A. Shutemov Cc: "Aneesh Kumar K . V" Cc: Arnd Bergmann Cc: Linus Torvalds Cc: Nick Piggin Cc: Peter Zijlstra Cc: Will Deacon Signed-off-by: Andrew Morton --- include/asm-generic/pgtable-nopmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/asm-generic/pgtable-nopmd.h~asm-generic-tlb-stub-out-pmd_free_tlb-if-nopmd +++ a/include/asm-generic/pgtable-nopmd.h @@ -60,7 +60,7 @@ static inline pmd_t * pmd_offset(pud_t * static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { } -#define __pmd_free_tlb(tlb, x, a) do { } while (0) +#define pmd_free_tlb(tlb, x, a) do { } while (0) #undef pmd_addr_end #define pmd_addr_end(addr, end) (end)