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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 D98AFC433F7 for ; Tue, 28 Jul 2020 11:19:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A456A2070A for ; Tue, 28 Jul 2020 11:19:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A456A2070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0FAA78D000E; Tue, 28 Jul 2020 07:19:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BBA08D0005; Tue, 28 Jul 2020 07:19:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDC3B8D000E; Tue, 28 Jul 2020 07:19:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id DB61D8D0005 for ; Tue, 28 Jul 2020 07:19:54 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 66E9D180AD817 for ; Tue, 28 Jul 2020 11:19:54 +0000 (UTC) X-FDA: 77087239908.28.steam33_0e0496b26f69 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 3F7BC6D6D for ; Tue, 28 Jul 2020 11:19:54 +0000 (UTC) X-HE-Tag: steam33_0e0496b26f69 X-Filterd-Recvd-Size: 2983 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jul 2020 11:19:53 +0000 (UTC) Received: from gaia (unknown [95.146.230.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D11532064B; Tue, 28 Jul 2020 11:19:50 +0000 (UTC) Date: Tue, 28 Jul 2020 12:19:48 +0100 From: Catalin Marinas To: Linus Torvalds Cc: Yu Xu , Andrew Morton , Johannes Weiner , Hillf Danton , Hugh Dickins , Josef Bacik , "Kirill A . Shutemov" , Linux-MM , mm-commits@vger.kernel.org, Will Deacon , Matthew Wilcox , Yang Shi Subject: Re: [patch 01/15] mm/memory.c: avoid access flag update TLB flush for retried page fault Message-ID: <20200728111947.GD706@gaia> References: <20200723211432.b31831a0df3bc2cbdae31b40@linux-foundation.org> <20200724041508.QlTbrHnfh%akpm@linux-foundation.org> <0323de82-cfbd-8506-fa9c-a702703dd654@linux.alibaba.com> <20200727110512.GB25400@gaia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 3F7BC6D6D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Mon, Jul 27, 2020 at 10:01:47AM -0700, Linus Torvalds wrote: > On Mon, Jul 27, 2020 at 4:05 AM Catalin Marinas wrote: > > It leaves the spurious flush in place but only local (though note that > > in a guest under KVM, all local TLBIs are upgraded to inner-shareable, > > so you'd not get the performance benefit). > > Is there a way to mark and override that for this case? > > It really makes no sense to distribute the TLB invalidation. Even if > some virtualization manager switches CPU's from under us at _just_ the > wrong moment, it doesn't matter. It's a spurious thing, at worst we'll > take one more exception on the other CPU that didn't get flushed after > all. Unfortunately, that configuration bit (force broadcast) also affects the I-cache invalidation. I guess we could experiment with turning it off and performing the TLB and I-cache invalidation on a vCPU migration. But we first need to figure out if the non-broadcast TLBI in this case does make a significant difference in this case (as per Will's comment, maybe we can make flush_tlb_fix_spurious_fault() a no-op). -- Catalin