From patchwork Tue Oct 15 19:19:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 11191553 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 C6B9F14E5 for ; Tue, 15 Oct 2019 19:19:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 94CA920854 for ; Tue, 15 Oct 2019 19:19:36 +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="X3D1iJXD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94CA920854 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 B9E7F8E0008; Tue, 15 Oct 2019 15:19:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B34B48E000A; Tue, 15 Oct 2019 15:19:33 -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 8EB6C8E000A; Tue, 15 Oct 2019 15:19:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 6180F8E0006 for ; Tue, 15 Oct 2019 15:19:33 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id F1740180AE7F3 for ; Tue, 15 Oct 2019 19:19:32 +0000 (UTC) X-FDA: 76046982984.12.wash69_1903554aa7309 X-Spam-Summary: 2,0,0,643fe4e540c1a036,d41d8cd98f00b204,vineet.gupta1@synopsys.com,: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:torvalds@linux-foundation.org::linux-snps-arc@lists.infradead.org:linux-kernel@vger.kernel.org:linux-arch@vger.kernel.org:vineet.gupta1@synopsys.com,RULES_HIT:41:355:379:541:966:967:968:973:988:989:1260:1261:1263:1311:1314:1345:1437:1515:1534:1542:1711:1730:1747:1777:1792:1801:1981:2194:2196:2199:2200:2393:2525:2553:2559:2564:2682:2685:2859:2911:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4184:4250:4321:4385:4425:4605:5007:6117:6119:6261:6653:7875:7903:9025:9121:9388:9389:10004:10049:11026:11232:11473:11658:11914:12043:12048:12297:12438:12517:12519:12555:12663:12679:12776:12895:13161:13229:13894:14096:14106:14107:14180:14181:14394:14 721:1484 X-HE-Tag: wash69_1903554aa7309 X-Filterd-Recvd-Size: 4682 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [198.182.47.102]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Oct 2019 19:19:31 +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 0A961C0CD8; Tue, 15 Oct 2019 19:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1571167170; bh=QoRWNXgQmTXSWkCzboQjwBzdj5f3LiiL+Z3W4U/gMbE=; h=From:To:Cc:Subject:Date:From; b=X3D1iJXD/KJExvy7ioaMSbK04DGqFIP/0KpMKxCSUxlEQQpvB0iFGxqNN7F9t+5/Q Ym2808nWEoG5SozZ+GeXU3EHuWRbSbQxuMgp5B/jEKGcfkWJadE0Zj7+VuMP61SkIG witktVhnTUOL3QzgI/TjfgLnfkbxDdcXwsY8lDQnmzjkIMFUfQDvqxZXbhBNOyWJv4 ZBnmAir2yWCEHCYZmIam8cEiPgC4ZkN/1cjh3VUXIJJtCKucwbKB8RHkvjVxtSTKO5 9VrdsWbPqOxhwI1pz34A4PwFT5AIZFWsPdPWkYZ/qdjiOi/LAHDFAYYETPVTKgwRkY +iG9r3wILX/UQ== 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 4B745A006B; Tue, 15 Oct 2019 19:19:26 +0000 (UTC) From: Vineet Gupta To: Arnd Bergmann , Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , "Kirill A . Shutemov" , Linus Torvalds Cc: linux-mm@kvack.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Vineet Gupta Subject: [PATCH v2 0/5] eldie generated code for folded p4d/pud Date: Tue, 15 Oct 2019 12:19:21 -0700 Message-Id: <20191015191926.9281-1-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 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: Hi, This series came out of seemingly naive exceursion into understanding/removing __ARCH_USE_5LEVEL_HACK from ARC port. With removal of 5LEVEL_HACK some extraneous code was bein generated | bloat-o-meter2 vmlinux-[AB]* | add/remove: 0/0 grow/shrink: 3/0 up/down: 130/0 (130) | function old new delta | free_pgd_range 548 660 +112 | p4d_clear_bad 2 20 +18 Which the patches here elides (for folded p4d/pud/pmd) | bloat-o-meter2 vmlinux-[BF]* | add/remove: 0/2 grow/shrink: 0/1 up/down: 0/-386 (-386) | function old new delta | pud_clear_bad 20 - -20 | p4d_clear_bad 20 - -20 | free_pgd_range 660 314 -346 The code savings are not a whole lot, but still worthwhile IMHO. Please review, test and apply. It seems to survive my usual battery of multibench, hakcbench etc. Thx, -Vineet --- Changes since v1 [1] - Per Linus Sugestion remvoed the extra ifdey'ery (hence not accumulating Kirill's ACks) - Added the RFC patch for pmd_free_tlb() after discussions [2] - Also throwing in the ARC patch which started this all (so we get the full context of patchset) - I'm ok if this goes via mm tree, should be non contentious and can drop this too if Andrew thinks otherwise [1] http://lists.infradead.org/pipermail/linux-snps-arc/2019-October/006263.html [2] http://lists.infradead.org/pipermail/linux-snps-arc/2019-October/006277.html --- Vineet Gupta (5): ARC: mm: remove __ARCH_USE_5LEVEL_HACK asm-generic/tlb: stub out pud_free_tlb() if nopud ... asm-generic/tlb: stub out p4d_free_tlb() if nop4d ... asm-generic/tlb: stub out pmd_free_tlb() if nopmd asm-generic/mm: stub out p{4,d}d_clear_bad() if __PAGETABLE_P{4,u}D_FOLDED arch/arc/include/asm/pgtable.h | 1 - arch/arc/mm/fault.c | 10 ++++++++-- arch/arc/mm/highmem.c | 4 +++- include/asm-generic/4level-fixup.h | 1 - include/asm-generic/5level-fixup.h | 1 - include/asm-generic/pgtable-nop4d.h | 2 +- include/asm-generic/pgtable-nopmd.h | 2 +- include/asm-generic/pgtable-nopud.h | 2 +- include/asm-generic/pgtable.h | 11 +++++++++++ include/asm-generic/tlb.h | 4 ---- mm/pgtable-generic.c | 8 ++++++++ 11 files changed, 33 insertions(+), 13 deletions(-)