From patchwork Wed Oct 9 22:26:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 11182293 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 5DF7914DB for ; Wed, 9 Oct 2019 22:27:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A40D2196E for ; Wed, 9 Oct 2019 22:27:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="cIRDG8mg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A40D2196E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2DE3C8E0003; Wed, 9 Oct 2019 18:27:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 267598E0007; Wed, 9 Oct 2019 18:27:11 -0400 (EDT) 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 F12058E0003; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id ABA1C6B0007 for ; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 537AD180AD801 for ; Wed, 9 Oct 2019 22:27:10 +0000 (UTC) X-FDA: 76025683020.13.hose21_448eda59af3d X-Spam-Summary: 2,0,0,b7dba39d5a72705e,d41d8cd98f00b204,vineet.gupta1@synopsys.com,::linux-snps-arc@lists.infradead.org:linux-kernel@vger.kernel.org:linux-arch@vger.kernel.org:arnd@arndb.de:will@kernel.org:aneesh.kumar@linux.ibm.com:akpm@linux-foundation.org:npiggin@gmail.com:peterz@infradead.org:kirill.shutemov@linux.intel.com:vineet.gupta1@synopsys.com,RULES_HIT:41:355:379:541:800:960:965:966:968:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:1978:1981:2194:2196:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3352:3866:4250:4321:4385:4390:4395:4605:5007:6114:6119:6261:6642:6653:6742:7208:7903:8784:9113:9121:10004:11026:11473:11658:11914:12043:12114:12296:12297:12438:12517:12519:12555:12895:12986:13069:13255:13311:13357:13894:14181:14384:14394:14581:14721:21080:21451:21627:30003:30012:30054,0,RBL:198.182.61.142:@synopsys.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache :0,MSF:n X-HE-Tag: hose21_448eda59af3d X-Filterd-Recvd-Size: 4183 Received: from smtprelay-out1.synopsys.com (dc2-smtprelay2.synopsys.com [198.182.61.142]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 22:27:09 +0000 (UTC) Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 21006C03E7; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1570660027; bh=+fXx98X7ZWlodVdTQmpmbXd7E1kSCADK/6WXe3QmHgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIRDG8mgI2ftLTQM4oxqslIpCO+BLxHMgPosEygMlLNYtUrCBPX7HDsVJZAAvgs+v MBdm2BR2LOOFSTZcnjQaS+qJl5O4cuoIsHsvc9mlMwcIoNWnLIILjeTHR+WFAIJzHU B8L/u6D/fkO2uaFTi21XUmWGCTg0vnELZxIOmiEBQLHRXsyFNGh7HsYUk35e7QQ7eV +S+TgO0TQxJTFVHmNjJXHyEIL58XZPnJdBuDYAbVDHFiPPWfcufJCgPxJM6plviC5H vKjcH3QfIS7Nv5fYwHF04NRonkEGe1Jia82mTrlbwP1erZvZxiRfKWmLJc6hbATUm4 /AGi62m11VFvw== Received: from vineetg-Latitude-E7450.internal.synopsys.com (vineetg-latitude-e7450.internal.synopsys.com [10.10.161.61]) by mailhost.synopsys.com (Postfix) with ESMTP id 8A22CA006D; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) From: Vineet Gupta To: linux-mm@kvack.org Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Arnd Bergmann , Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , "Kirill A . Shutemov" , Vineet Gupta Subject: [PATCH 1/3] asm-generic/tlb: stub out pud_free_tlb() if __PAGETABLE_PUD_FOLDED ... Date: Wed, 9 Oct 2019 15:26:56 -0700 Message-Id: <20191009222658.961-2-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191009222658.961-1-vgupta@synopsys.com> References: <20191009222658.961-1-vgupta@synopsys.com> MIME-Version: 1.0 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: ... independent of __ARCH_HAS_4LEVEL_HACK This came up when removing __ARCH_HAS_5LEVEL_HACK for ARC as code bloat from pud_free_tlb() despite pud being folded (with 2 levels on ARC) | 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% Signed-off-by: Vineet Gupta --- include/asm-generic/4level-fixup.h | 2 -- include/asm-generic/tlb.h | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index e3667c9a33a5..d7c5ba1968d3 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h @@ -27,8 +27,6 @@ #define pud_page(pud) pgd_page(pud) #define pud_page_vaddr(pud) pgd_page_vaddr(pud) -#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) diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 04c0644006fd..1f83188cb331 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -584,7 +584,7 @@ static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vm } while (0) #endif -#ifndef __ARCH_HAS_4LEVEL_HACK +#ifndef __PAGETABLE_PUD_FOLDED #ifndef pud_free_tlb #define pud_free_tlb(tlb, pudp, address) \ do { \ @@ -594,6 +594,8 @@ static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vm __pud_free_tlb(tlb, pudp, address); \ } while (0) #endif +#else +#define pud_free_tlb(tlb, pudp, address) do { } while (0) #endif #ifndef __ARCH_HAS_5LEVEL_HACK From patchwork Wed Oct 9 22:26:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 11182295 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 4206C14DB for ; Wed, 9 Oct 2019 22:27:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D4F62196E for ; Wed, 9 Oct 2019 22:27:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="XvdFUi+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D4F62196E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 580228E0006; Wed, 9 Oct 2019 18:27:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 39F208E0008; Wed, 9 Oct 2019 18:27:11 -0400 (EDT) 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 0E1B78E0006; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id D01AF6B0008 for ; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 69996180AD803 for ; Wed, 9 Oct 2019 22:27:10 +0000 (UTC) X-FDA: 76025683020.10.night10_44a63b71a55f X-Spam-Summary: 2,0,0,68f188de0c9691da,d41d8cd98f00b204,vineet.gupta1@synopsys.com,::linux-snps-arc@lists.infradead.org:linux-kernel@vger.kernel.org:linux-arch@vger.kernel.org:arnd@arndb.de:will@kernel.org:aneesh.kumar@linux.ibm.com:akpm@linux-foundation.org:npiggin@gmail.com:peterz@infradead.org:kirill.shutemov@linux.intel.com:vineet.gupta1@synopsys.com,RULES_HIT:41:355:379:541:800:960:965:966:968:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1542:1711:1730:1747:1777:1792:1801:1978:1981:2194:2196:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3353:3866:4250:4321:4385:4390:4395:4605:5007:6114:6119:6261:6642:6653:6742:7208:7903:8784:9113:9121:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:12986:13255:13894:14181:14394:14721:21080:21451:21627:30003:30012:30054,0,RBL:198.182.61.142:@synopsys.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL: neutral, X-HE-Tag: night10_44a63b71a55f X-Filterd-Recvd-Size: 4242 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [198.182.61.142]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 22:27:09 +0000 (UTC) Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 259C4C03E9; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1570660027; bh=XxzbN0PHHliJ1GEgTBBhwhTwFL7gliZm+a80vwiducE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvdFUi+ZLbje6h/k7NQ+34A51uDkE4f0v62XxLwgo5K4i6n/pQIc8QGF8929MXasd 4dHo69SZnO+cf4qoy1n915cdiAwVb9PWQdgcqdkU1a7XPqLvspjhePiYVTWGIOKdpx 10MtHWYcdFiGuS8ceKnSxwYF9ueaiHOmvC6eQ5fwPJzXEcpOD689UpJCANu55ZAGsv 4Qwa2dTx5DSW/8pDRpIC8glXW///WreThFJZo2dwSGt6I+wtjggkOdrfE2wSpejs32 pIA5UyCEwI5cDUS/1wxpFWQieMn/bz8qenl8YJsFQNwqs+Hk3Nvm2/ewIlZ4vV9qpx lxKnoQGk8Gcgw== Received: from vineetg-Latitude-E7450.internal.synopsys.com (vineetg-latitude-e7450.internal.synopsys.com [10.10.161.61]) by mailhost.synopsys.com (Postfix) with ESMTP id 9A5B7A0074; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) From: Vineet Gupta To: linux-mm@kvack.org Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Arnd Bergmann , Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , "Kirill A . Shutemov" , Vineet Gupta Subject: [PATCH 2/3] asm-generic/tlb: stub out p4d_free_tlb() if __PAGETABLE_P4D_FOLDED ... Date: Wed, 9 Oct 2019 15:26:57 -0700 Message-Id: <20191009222658.961-3-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191009222658.961-1-vgupta@synopsys.com> References: <20191009222658.961-1-vgupta@synopsys.com> MIME-Version: 1.0 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: ... independent of __ARCH_HAS_5LEVEL_HACK This came up when removing __ARCH_HAS_5LEVEL_HACK for ARC as code bloat from p4d_free_tlb() despite pud being folded (with 2 levels on ARC) | 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% Signed-off-by: Vineet Gupta --- include/asm-generic/5level-fixup.h | 2 -- include/asm-generic/tlb.h | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/5level-fixup.h b/include/asm-generic/5level-fixup.h index f6947da70d71..c855b5cf4425 100644 --- a/include/asm-generic/5level-fixup.h +++ b/include/asm-generic/5level-fixup.h @@ -48,8 +48,6 @@ static inline int p4d_present(p4d_t p4d) #define __p4d(x) __pgd(x) #define set_p4d(p4dp, p4d) set_pgd(p4dp, 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) diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 1f83188cb331..f3dad87f4ecc 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -598,7 +598,7 @@ static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vm #define pud_free_tlb(tlb, pudp, address) do { } while (0) #endif -#ifndef __ARCH_HAS_5LEVEL_HACK +#ifndef __PAGETABLE_P4D_FOLDED #ifndef p4d_free_tlb #define p4d_free_tlb(tlb, pudp, address) \ do { \ @@ -607,6 +607,8 @@ static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vm __p4d_free_tlb(tlb, pudp, address); \ } while (0) #endif +#else +#define p4d_free_tlb(tlb, pudp, address) do { } while (0) #endif #endif /* CONFIG_MMU */ From patchwork Wed Oct 9 22:26:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 11182289 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 BD11215AB for ; Wed, 9 Oct 2019 22:27:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A51C206BB for ; Wed, 9 Oct 2019 22:27:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="GgP6kaNk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A51C206BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B4BAA8E0005; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A7E866B0006; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) 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 927456B0007; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 6AD066B0003 for ; Wed, 9 Oct 2019 18:27:10 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id EA94C824CA39 for ; Wed, 9 Oct 2019 22:27:09 +0000 (UTC) X-FDA: 76025682978.26.bikes48_4484cf640552 X-Spam-Summary: 2,0,0,47795012b27d3c30,d41d8cd98f00b204,vineet.gupta1@synopsys.com,::linux-snps-arc@lists.infradead.org:linux-kernel@vger.kernel.org:linux-arch@vger.kernel.org:arnd@arndb.de:will@kernel.org:aneesh.kumar@linux.ibm.com:akpm@linux-foundation.org:npiggin@gmail.com:peterz@infradead.org:kirill.shutemov@linux.intel.com:vineet.gupta1@synopsys.com,RULES_HIT:41:355:379:541:800:960:966:968:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:1978:1981:2194:2196:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3868:3870:4321:4385:4605:5007:6119:6261:6653:6742:7208:7903:9113:9121:10004:11026:11473:11658:11914:12043:12114:12297:12438:12517:12519:12555:12895:12986:13069:13255:13311:13357:13894:14096:14181:14384:14394:14581:14721:21080:21451:21627:30012:30054,0,RBL:198.182.61.142:@synopsys.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0, DNSBL:ne X-HE-Tag: bikes48_4484cf640552 X-Filterd-Recvd-Size: 4144 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [198.182.61.142]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 22:27:09 +0000 (UTC) Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 32D33C03EA; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1570660027; bh=VhQHSn2scrt/qLb1cp8mUcqKwCHy/B+Kzh4ZumuFBfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgP6kaNk3OUsXe+9Z6UeDQpLd4pr7C/0F+HHRYYvvgbB5T0xlOdbnFyJCbSVRQBH6 tY0qa8Or/HpDF2v0Vyt0djRcdRkjPKoWYRcV8Yq58z9jgIJjeBmcmHYSQR56aaOmuV 0yDM4ohgjmBXm86vMIVuQ3M8OPao9yPvvOyefPnWg8PsqdsAH1Ncav3x3a5mPfLwVU M7LbqxQq7WTtjw/BAbf58djskxwaJDMalSv2pXnY7/WTrvAPYXNygzhZRaB3UoC5YN Zcpp0Gw23/hIBUudH7a5CSvjNOxJoezUSr1ZS/9iVXtIT/T3yyBS4LwG6NB+OoA6lH LjGChWQGNroPQ== Received: from vineetg-Latitude-E7450.internal.synopsys.com (vineetg-latitude-e7450.internal.synopsys.com [10.10.161.61]) by mailhost.synopsys.com (Postfix) with ESMTP id AA9C8A0072; Wed, 9 Oct 2019 22:27:06 +0000 (UTC) From: Vineet Gupta To: linux-mm@kvack.org Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Arnd Bergmann , Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , "Kirill A . Shutemov" , Vineet Gupta Subject: [PATCH 3/3] asm-generic/mm: stub out p{4,d}d_clear_bad() if __PAGETABLE_P{4,u}D_FOLDED Date: Wed, 9 Oct 2019 15:26:58 -0700 Message-Id: <20191009222658.961-4-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191009222658.961-1-vgupta@synopsys.com> References: <20191009222658.961-1-vgupta@synopsys.com> MIME-Version: 1.0 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: This removes the code for 2 level paging as seen on ARC | bloat-o-meter2 vmlinux-D-elide-p4d_free_tlb vmlinux-E-elide-p?d_clear_bad | add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-22 (-22) | function old new delta | pud_clear_bad 20 - -20 | p4d_clear_bad 20 - -20 | Total: Before=4137104, After=4137082, chg -1.000000% Signed-off-by: Vineet Gupta --- include/asm-generic/pgtable.h | 11 +++++++++++ mm/pgtable-generic.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 818691846c90..9cdcbc7c0b7b 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -558,8 +558,19 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) * Do the tests inline, but report and clear the bad entry in mm/memory.c. */ void pgd_clear_bad(pgd_t *); + +#ifndef __PAGETABLE_P4D_FOLDED void p4d_clear_bad(p4d_t *); +#else +#define p4d_clear_bad(p4d) do { } while (0) +#endif + +#ifndef __PAGETABLE_PUD_FOLDED void pud_clear_bad(pud_t *); +#else +#define pud_clear_bad(p4d) do { } while (0) +#endif + void pmd_clear_bad(pmd_t *); static inline int pgd_none_or_clear_bad(pgd_t *pgd) diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 532c29276fce..856dc3bb77e6 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -24,17 +24,21 @@ void pgd_clear_bad(pgd_t *pgd) pgd_clear(pgd); } +#ifndef __PAGETABLE_P4D_FOLDED void p4d_clear_bad(p4d_t *p4d) { p4d_ERROR(*p4d); p4d_clear(p4d); } +#endif +#ifndef __PAGETABLE_PUD_FOLDED void pud_clear_bad(pud_t *pud) { pud_ERROR(*pud); pud_clear(pud); } +#endif void pmd_clear_bad(pmd_t *pmd) {