From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49B79ECE58D for ; Fri, 11 Oct 2019 22:38:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F39832089F for ; Fri, 11 Oct 2019 22:38:31 +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="A6IYKky8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F39832089F 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 9CF368E0001; Fri, 11 Oct 2019 18:38:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 97E5E6B0005; Fri, 11 Oct 2019 18:38:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8935D8E0001; Fri, 11 Oct 2019 18:38:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 61F916B0003 for ; Fri, 11 Oct 2019 18:38:31 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id ED7AF181AC9AE for ; Fri, 11 Oct 2019 22:38:30 +0000 (UTC) X-FDA: 76032969180.08.brick87_4a36232de0b0d X-HE-Tag: brick87_4a36232de0b0d X-Filterd-Recvd-Size: 4425 Received: from smtprelay-out1.synopsys.com (us03-smtprelay2.synopsys.com [149.117.87.133]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Oct 2019 22:38:29 +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 80CEFC04A7; Fri, 11 Oct 2019 22:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1570833508; bh=E0P1RFAQD2Jf3g/rlBhYfNzwHdOeyXPqBOG/QZTvieM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A6IYKky8AdyUQ2QMjcIa2Uj+0XJjLeGbu6SH7JKVYKXMO6VLVywzRybptkCdTakG0 RDHIGz82Gfiajkpm4OCoDCz9X4UjVucNxnWyUWfz+tlwwNcSs1lfGeqyUqmRKJ3LFS tBwLL8Ru9EXyP/LBxMEtY6xAHed0FQeC59VOQqR9UUlgMl+BFNEPVVNI9SqOd5WLg0 jRQ+NyVOSXkfzBGVDgUyBMjNBT83MBQiNVhn3m6ENnXJdTZM9bDCep+rLXiai1UQkv UIYZzv9FSGgroLSDe0WPaDu0yK3CsCcEcUiNmvP+v0zljLl4HIl6q2weZjeDtxqIVu zIeuNs1TDq8ZA== 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 AC1E4A006B; Fri, 11 Oct 2019 22:38:21 +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" , Linus Torvalds , Vineet Gupta Subject: [RFC] asm-generic/tlb: stub out pmd_free_tlb() if __PAGETABLE_PMD_FOLDED Date: Fri, 11 Oct 2019 15:38:18 -0700 Message-Id: <20191011223818.7238-1-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191011121951.nxna6hruuskvdxod@box> References: <20191011121951.nxna6hruuskvdxod@box> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 is inine with similar patches for nopud [1] and nop4d [2] cases. However I'm not really sure I understand clearly how the nopmd code is supposed to work (for a 2 tier paging system) - hence the RFC. Consider free_pmd_range() simplified/annotated below free_pmd_range ... pmd =3D pmd_offset(pud, addr); do { next =3D pmd_addr_end(addr, end); if (pmd_none_or_clear_bad(pmd)) =3D> *pmd_bad()/pmd_clear_bad() [a]* continue; free_pte_range(tlb, pmd, addr); } while (pmd++, addr =3D next, addr !=3D end); ... *pmd_free_tlb(tlb, pmd, start); =3D> [b]* For ARC/nopmd case [a] is actually checking pgd and consequently pmd_clear_bad() can't be stubbed out for PMD_FOLDED case. However it s= eems case [b] can be stubbed out (hence this patch) along same lines as [1]= and [2] | bloat-o-meter2 vmlinux-E-elide-p?d_clear_bad vmlinux-F-elide-pmd_free_t= lb | 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=3D4137002, After=3D4136890, chg -1.000000% [1] http://lists.infradead.org/pipermail/linux-snps-arc/2019-October/0062= 66.html [2] http://lists.infradead.org/pipermail/linux-snps-arc/2019-October/0062= 65.html Signed-off-by: Vineet Gupta --- include/asm-generic/tlb.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index f3dad87f4ecc..a1edad7d4170 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -574,6 +574,7 @@ static inline void tlb_end_vma(struct mmu_gather *tlb= , struct vm_area_struct *vm } while (0) #endif =20 +#ifndef __PAGETABLE_PMD_FOLDED #ifndef pmd_free_tlb #define pmd_free_tlb(tlb, pmdp, address) \ do { \ @@ -583,6 +584,9 @@ static inline void tlb_end_vma(struct mmu_gather *tlb= , struct vm_area_struct *vm __pmd_free_tlb(tlb, pmdp, address); \ } while (0) #endif +#else +#define pmd_free_tlb(tlb, pmdp, address) do { } while (0) +#endif =20 #ifndef __PAGETABLE_PUD_FOLDED #ifndef pud_free_tlb --=20 2.20.1