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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 4D253C1975A for ; Wed, 25 Mar 2020 16:42:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16F0C2073E for ; Wed, 25 Mar 2020 16:42:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="mgZzgtby" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16F0C2073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 964486B00B3; Wed, 25 Mar 2020 12:42:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 913876B00B5; Wed, 25 Mar 2020 12:42:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82A146B00B7; Wed, 25 Mar 2020 12:42:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 67B6C6B00B3 for ; Wed, 25 Mar 2020 12:42:12 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 420AE181AD84F for ; Wed, 25 Mar 2020 16:42:12 +0000 (UTC) X-FDA: 76634452104.11.group46_4d662f560274b X-HE-Tag: group46_4d662f560274b X-Filterd-Recvd-Size: 3995 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 16:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mRHWpcrmchRbU0owKTcqFGIDS9+Dwj9bNBh2URMrFd8=; b=mgZzgtbyEo8KJZgK8cuoRLaS3F 80P9siBMVb+J7I87vgTBr0msEZJWoQrRxICZd2DgP/r7wAk9LA6mVCRmcznNentWYNbzUndA/nEvY CidVPrN8hF6oFANViKQraeI8RhulIBtzVr4a9uCYc9hLZW5ak3KEYxRSuW8gaJjtKGe8/9bvE2vjY WS0nCwbe+8zOexAYCy1Z9L4ymiknO5OI5gBa49Q2AiYELwqgzKGsaxGuFe8LCKk4bkz13+LMzbNTe OVo60W2gGGnSx4vqxqt1b7v1bR9JFJYyLV6taQrAAmRwOrw7ItfWOMSv5NuFXSfhekYfHQgMFyes7 nmRODt0A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jH96B-0004TC-6K; Wed, 25 Mar 2020 16:41:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 813823010CF; Wed, 25 Mar 2020 17:41:44 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 665E829A7FACF; Wed, 25 Mar 2020 17:41:44 +0100 (CET) Date: Wed, 25 Mar 2020 17:41:44 +0100 From: Peter Zijlstra To: James Morse Cc: Zhenyu Ye , will@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, npiggin@gmail.com, arnd@arndb.de, rostedt@goodmis.org, maz@kernel.org, suzuki.poulose@arm.com, tglx@linutronix.de, yuzhao@google.com, Dave.Martin@arm.com, steven.price@arm.com, broonie@kernel.org, guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, arm@kernel.org, xiexiangyou@huawei.com, prime.zeng@hisilicon.com, zhangshaokun@hisilicon.com Subject: Re: [RFC PATCH v4 0/6] arm64: tlb: add support for TTL feature Message-ID: <20200325164144.GB20696@hirez.programming.kicks-ass.net> References: <20200324134534.1570-1-yezhenyu2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 25, 2020 at 04:15:58PM +0000, James Morse wrote: > Hi Zhenyu, > > On 3/24/20 1:45 PM, Zhenyu Ye wrote: > > In order to reduce the cost of TLB invalidation, the ARMv8.4 TTL > > feature allows TLBs to be issued with a level allowing for quicker > > invalidation. This series provide support for this feature. > > > > Patch 1 and Patch 2 was provided by Marc on his NV series[1] patches, > > which detect the TTL feature and add __tlbi_level interface. > > How does this interact with THP? > (I don't see anything on that in the series.) > > With THP, there is no one answer to the size of mapping in a VMA. > This is a problem because the arm-arm has in "Translation table level > hints" in D5.10.2 of DDI0487E.a: > | If an incorrect value for the entry being invalidated by the > | instruction is specified in the TTL field, then no entries are > | required by the architecture to be invalidated from the TLB. > > If we get it wrong, not TLB maintenance occurs! > > Unless THP leaves its fingerprints on the vma, I think you can only do > this for VMA types that THP can't mess with. (see > transparent_hugepage_enabled()) The convention way to deal with that is to issue the TBLI for all possible sizes. Power9 has all this, please look there.