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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F13C6C001DC for ; Mon, 31 Jul 2023 11:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8bt/N6TDen9svkJsYFsgcbFrOSWey9aXgcnHJ6vifYM=; b=czzankE1uLEsk3 GlrG5PkIGtMy/1Bu7FHspRNXRxvRjc1pcCgwrNmvxtUOijLl5Gzj8bkihzTVtMaf6esfAPm6Qjr7c ZZnWEbuxxmxXjQ++ydypK2ays9CoA0V580z4dLUBgLijzvYRQyCod6+JsuR6kF5232WK4x5JZ+tOX Rm7L5FZWHhSy6Fk0nLrhKqmSuOHiUCxZ93cpZU+f0flgfq3sAK3xjc4zg6FL37Ao0b4upR9LJc1JQ R4aw/+Ls+NPDNtQAmumL0ffX5N01J/eL46vvJbHBdL04iP3DCcHmEdgqfkJeE9Y/Z8mI5wXmbXJmD VjYwJDpGUIlyWIT9a8Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQQoc-00FIqG-0i; Mon, 31 Jul 2023 11:11:54 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQQoZ-00FIpo-1g for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 11:11:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9507E6102E; Mon, 31 Jul 2023 11:11:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A632AC433C7; Mon, 31 Jul 2023 11:11:42 +0000 (UTC) Date: Mon, 31 Jul 2023 12:11:34 +0100 From: Catalin Marinas To: Kefeng Wang Cc: Andrew Morton , Will Deacon , Mike Kravetz , Muchun Song , Mina Almasry , kirill@shutemov.name, joel@joelfernandes.org, william.kucharski@oracle.com, kaleshsingh@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] arm64: tlb: set huge page size to stride for hugepage Message-ID: References: <20230731074829.79309-1-wangkefeng.wang@huawei.com> <20230731074829.79309-5-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230731074829.79309-5-wangkefeng.wang@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_041151_603908_6062A435 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 31, 2023 at 03:48:29PM +0800, Kefeng Wang wrote: > +/* > + * We cannot use leaf-only invalidation here, since we may be invalidating > + * table entries as part of collapsing hugepages or moving page tables. > + * Set the tlb_level to 0 because we can not get enough information here. > + */ > +#define flush_tlb_range(vma, start, end) \ > + __flush_tlb_range(vma, start, end, \ > + ((vma)->vm_flags & VM_HUGETLB) \ > + ? huge_page_size(hstate_vma(vma)) \ > + : PAGE_SIZE, false, 0) This won't work if we use the contiguous PTE to get 64K hugetlb pages on a 4K base page configuration. The 16 base pages in the range would have to be invalidated individually (the contig PTE bit is just a hint, the hardware may or may not take it into account). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel