Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2735287imm; Fri, 24 Aug 2018 04:35:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNE/uFvu7Z46HPSMvyifLAqHxBfQwKCCBHzdMU4ud9e8a3L7yUwZts5EDsda5qKo5+we+G X-Received: by 2002:a17:902:b949:: with SMTP id h9-v6mr1249619pls.157.1535110512863; Fri, 24 Aug 2018 04:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535110512; cv=none; d=google.com; s=arc-20160816; b=Q8muz76pcYz7rYQFUB3oxx2gNDj7WsVZvFzd7yeSp8AgJ6NegaMC1E79kpHEdWvet9 3lUY3upZehjro6II/YEm+GZTLnUaUOGmHeR8wt2Jw5Xjh/l6NSad2UpRCJQVfU5z0e6k EAlJ3IOUNFF9azxevulFO/B6DXbj+ktTPu8MpUx0pL+y9GgLl79f+UaGu4o5QKfRpZh1 cU+XpBB2IIRfR0UNzE66Wvrifuou8fp3i5gungfZdBvdq6hPlO3TxtW/PmsfqSQRnn3U Ezvk3KI2Mnh1XDoiypsy3/B0STOSL7jgR8NjvlrwH0zRANybyGf79B14Gz+6wO19XXim DGLA== 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=LLUAsvFjVQOLC+/BSMcQKo/dW4L9MjA8mSmGzF68crc=; b=xworoLYv2nkVfYF1uP0NB5vMQJUXVBMNSpqV9H5yvMv7/XFUY2b3yQs6rk84JPo1OB p0onkzWd9BY+jk0xVSvAkV8n8QK4DshcnqCKz1vVhWqpzCSXHTKtfuPfWwRoa5CpPAoY MvFwRZw2IGobQxwfX0Hl1cTVhlmhjrNahPsh/2OJysGTrdUhVjmeCV3zMBno1O4OB6Ht 21ELGcO8aIsqK7Ig0WoWoOb0xSv8R12qIPsaQEbmLqjwdj4Onjd/mnP5Lc7W5ZmNeJBm RHAnDO7Z6cTNYiiGhTNGeJ6q0v5okQZqVuw+cX6Fmv2KWkh1QNR7LapNcOVh7cLEtU1U a4Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=HsmqB+sK; 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 t77-v6si6611898pgb.363.2018.08.24.04.34.57; Fri, 24 Aug 2018 04:35:12 -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=HsmqB+sK; 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 S1727581AbeHXPHN (ORCPT + 99 others); Fri, 24 Aug 2018 11:07:13 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39414 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726513AbeHXPHN (ORCPT ); Fri, 24 Aug 2018 11:07:13 -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=LLUAsvFjVQOLC+/BSMcQKo/dW4L9MjA8mSmGzF68crc=; b=HsmqB+sKvF50iqyNZ34dbENZ2 M+nSBAD/vP7bdyTaB34a4rjmKp+gOg/H4U2cwUGlG+xxeibMNHoYzBMPGM7goDSwMHBdbP55RmmEZ XC6kCDjbbWtWL78ThRaDlxW+QA6Idx7FvOct50ZmlqsO08KJTA7sgFILlEYHSKIhPoBTycInNfWJU 4h3qd71wVd7iHGFONlOQ9XNgr+oOLiVWqLRRWhymkv/5QhBCeI5SkxnMf0mmDfZsng0Qj8R/8zRUE U7PgIzS+Yv8D0ijYEbajF6R4wHZSR9GSmdHgM5GemCeFDCTSAHFvV7ef+jjGjM1YRUIa7dkwKBHSw vZ7nm0gfg==; 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 1ftAKA-0000eb-VX; Fri, 24 Aug 2018 11:32:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0B8A82024D44B; Fri, 24 Aug 2018 13:32:15 +0200 (CEST) Date: Fri, 24 Aug 2018 13:32:14 +0200 From: Peter Zijlstra To: Will Deacon Cc: 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: <20180824113214.GK24142@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: <20180824084717.GK24124@hirez.programming.kicks-ass.net> 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:47:17AM +0200, 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. Hurm.. look at commit: e77b0852b551 ("mm/mmu_gather: track page size with mmu gather and force flush if page size change") yuck yuck yuck. That needs fixing.