Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3133858imm; Fri, 24 Aug 2018 11:07:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaBJMNJhAVwJTx3Stq5I7NDPk+xnHCbQ0Vdm60clOKRTG52i2VksV9txDCredmJQfRF2ax8 X-Received: by 2002:a17:902:3324:: with SMTP id a33-v6mr2621565plc.221.1535134066133; Fri, 24 Aug 2018 11:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535134066; cv=none; d=google.com; s=arc-20160816; b=MHS68tfIpiD8JyJlPklndsIgidJxgRBLfT/xTpl1YA/fmSlkZ5DeAgxyQr2C+1I20U GJRU5r6UFuxVB/lw+bKQ3jhvtyhWGm3L72blY63Gg3Zp6ESYsRNsKiBS+VHl4bIMN3o9 q7zAexA7l0NUnS6gBBloIJsCC6cz4TM409iWUB2VxNx/R3OpSsmGCYI3DY1EORRHsWCp 5MWpwW2OKnI5jPlXp2IxOJ+6g5zHr2OH8xEychE12eY95rRdlJWTLAtBvVYEyXBZAlNW S+hVUFceesEezHI5mI2dAWnDcb6rOJ7Xqske6F8ikpw1m/Nr+Gjg+JM2BGhPGbeqCcvD QOvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=AzwP5RXx0P6C9ot7UWWrNI54FAUp9QwpmRWsv2inhI8=; b=jF9EFBLfnXlf/nDR6FNMCfLTi6XDJObhYfYwUTNWa9JOYP0EV7yQh5ueFLchPfMPtb HUcnqkRvyCdr5YG4VNMzuKWrKhRuauO1LzFceCQXxc2XTXx2VZtyHQeIIaJd44Fk9mLp +cpdSqVnzAfyD5Bnw0Fx8K/xqefvMBvZ/I5Z0LYcmxqOcOxwyHcx6FLdHXA9mv/BU1B+ bGtz8uI9xNs7wb7wkyIS6TvhLyrrUsOiOmFQic53Tg1rdbWttCKTx77TPKikfHdUPQFU eMSblkpT3RZwrqL9uRFLa4nl/5+Yu5MmMZ8CNNV5xRsu7LYNr+S922VuGliv1vVFYWcv Ybaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=STPqXDbu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si7004472plp.233.2018.08.24.11.07.30; Fri, 24 Aug 2018 11:07:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=STPqXDbu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbeHXVky (ORCPT + 99 others); Fri, 24 Aug 2018 17:40:54 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49486 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeHXVky (ORCPT ); Fri, 24 Aug 2018 17:40:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AzwP5RXx0P6C9ot7UWWrNI54FAUp9QwpmRWsv2inhI8=; b=STPqXDbuWnj/ua3nCnDUizO+h 9LyrzC1V+bR1mldGL0ZfiL7YjKhGNlt5wicLZwEvIQRR+/TALa8cCkCNWr02SrZC1876pQnVmMP4z tqTS1FeZmlZaHeSqYcFxC1/MF6y16kQ/Ss+VIdaBEAngJhvKFISgJJktbXLbMHsGDZGYA7/Bo6/qj ecuKWhq5knX4bZiaAx8h4YkUZ4HsQrakqXVSr2mJe7TAy+Xv4UbrDPV81e44sYrE+l53gYeJdec2h ZLQIeq9dk59wXgX0+GAYnRzmRJMIhUiz28sSriDfibNMWwQRoVRIVYP6lkjNSaSpH+g+Mnvg6lBjT C9H4GGpWA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftGRr-0004A5-I9; Fri, 24 Aug 2018 18:04:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5339D2024D705; Fri, 24 Aug 2018 20:04:38 +0200 (CEST) Date: Fri, 24 Aug 2018 20:04:38 +0200 From: Peter Zijlstra To: Nadav Amit Cc: Will Deacon , Linus Torvalds , Benjamin Herrenschmidt , Nick Piggin , Andrew Lutomirski , the arch/x86 maintainers , Borislav Petkov , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman Subject: Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE Message-ID: <20180824180438.GS24124@hirez.programming.kicks-ass.net> References: <20180822153012.173508681@infradead.org> <20180822154046.823850812@infradead.org> <20180822155527.GF24124@hirez.programming.kicks-ass.net> <20180823134525.5f12b0d3@roar.ozlabs.ibm.com> <776104d4c8e4fc680004d69e3a4c2594b638b6d1.camel@au1.ibm.com> <20180823133958.GA1496@brain-police> <20180824084717.GK24124@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 24, 2018 at 10:26:50AM -0700, Nadav Amit wrote: > at 1:47 AM, Peter Zijlstra wrote: > > > On Thu, Aug 23, 2018 at 02:39:59PM +0100, Will Deacon wrote: > >> The only problem with this approach is that we've lost track of the granule > >> size by the point we get to the tlb_flush(), so we can't adjust the stride of > >> the TLB invalidations for huge mappings, which actually works nicely in the > >> synchronous case (e.g. we perform a single invalidation for a 2MB mapping, > >> rather than iterating over it at a 4k granule). > >> > >> One thing we could do is switch to synchronous mode if we detect a change in > >> granule (i.e. treat it like a batch failure). > > > > We could use tlb_start_vma() to track that, I think. Shouldn't be too > > hard. > > Somewhat unrelated, but I use this opportunity that TLB got your attention > for something that bothers me for some time. clear_fixmap(), which is used > in various places (e.g., text_poke()), ends up in doing only a local TLB > flush (in __set_pte_vaddr()). > > Is that sufficient? Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this during PTI, but I seem to have forgotten everything again.