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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56058C433EF for ; Tue, 5 Apr 2022 14:27:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C12EB6B0071; Tue, 5 Apr 2022 10:26:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC2446B0073; Tue, 5 Apr 2022 10:26:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A89D76B0074; Tue, 5 Apr 2022 10:26:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 96F0F6B0071 for ; Tue, 5 Apr 2022 10:26:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4CAD2183BCDBA for ; Tue, 5 Apr 2022 14:26:42 +0000 (UTC) X-FDA: 79323051444.24.A58D02C Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id AE67B40021 for ; Tue, 5 Apr 2022 14:26:41 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4AAB1B81D6B; Tue, 5 Apr 2022 14:26:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4FA4C385A4; Tue, 5 Apr 2022 14:26:37 +0000 (UTC) Date: Tue, 5 Apr 2022 15:26:34 +0100 From: Catalin Marinas To: Steve Capper Cc: linux-mm@kvack.org, David Hildenbrand , Peter Zijlstra , Anshuman Khandual , Will Deacon Subject: Re: [PATCH v2] tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry Message-ID: References: <8d5f53c2-2e67-66e4-6453-946a62d5ee98@arm.com> <20220330112543.863-1-steve.capper@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220330112543.863-1-steve.capper@arm.com> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AE67B40021 X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf07.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-Stat-Signature: ybbb9sok1trkg8og8i59o16ez5kmcyik X-HE-Tag: 1649168801-712282 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: On Wed, Mar 30, 2022 at 12:25:43PM +0100, Steve Capper wrote: > tlb_remove_huge_tlb_entry only considers PMD_SIZE and PUD_SIZE when > updating the mmu_gather structure. > > Unfortunately on arm64 there are two additional huge page sizes that > need to be covered: CONT_PTE_SIZE and CONT_PMD_SIZE. Where an end-user > attempts to employ contiguous huge pages, a VM_BUG_ON can be experienced > due to the fact that the tlb structure hasn't been correctly updated by > the relevant tlb_flush_p.._range() call from tlb_remove_huge_tlb_entry. > > This patch adds inequality logic to the generic implementation of > tlb_remove_huge_tlb_entry s.t. CONT_PTE_SIZE and CONT_PMD_SIZE are > effectively covered on arm64. Also, as well as ptes, pmds and puds; > p4ds are now considered too. > > Reported-by: David Hildenbrand > Suggested-by: Peter Zijlstra (Intel) > Cc: Anshuman Khandual > Cc: Catalin Marinas > Cc: Will Deacon > Link: https://lore.kernel.org/linux-mm/811c5c8e-b3a2-85d2-049c-717f17c3a03a@redhat.com/ > Signed-off-by: Steve Capper Reviewed-by: Catalin Marinas