Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2592344imm; Fri, 24 Aug 2018 01:49:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY5OC7cb5hXqvy694CTflY0GJl55lmL7MRSxeCoGECHUnPOZgzGw2X5HMpDjxzB/NTy2pkn X-Received: by 2002:a63:4207:: with SMTP id p7-v6mr767838pga.201.1535100575879; Fri, 24 Aug 2018 01:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535100575; cv=none; d=google.com; s=arc-20160816; b=T34vYVlXKF8j9hIABKIf1wxG7L9XwInjIrl/dbNqz/3TX3dULidK1wTtOn1jbofxu+ 77ujaaCDnOMSqqFHjadLwTavz0Libo+5On3mt0Go2LvgAVhHEo9CoIVnArPsJD48Lthc Xc6adXnOSD7G3iU1zSOxCAtXS7eR4nDo6Dwy9/UFOyTHTaPutvWfzX7QEKd6mxIBEl6W 6R8tBVdX5agsOTZpubS0mvt46Aat72wIbDYE+zeXFKRuaAlOhHFUIEpvNl3KSIRvK2fj QEaWBMtn4hHuEf/hfrHkWiRQ0l6/Wa9yTEXF5GwVl6ng44zHDfoHSeKk9b5axpU9UA/l d9OA== 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=W4K9GHyio6iakjM4D7I305435E1QN4Pp7/tITQv6UZY=; b=eT8zageY6u3FJZiPl7/15zujU+Wm0KPCWGIb1Ly34HsyPATtwNNrzemPdygp7rdE+i +2byVl2U9EoOZC0mCEr5ZjuVK7rN8wgxLPKJeZrj1x2zqw4J4TLU5XIRKQ7Z0Rha3iOW +rgUlftGmPTdpYQKKznZfX9fJGKzj6+eK+4pPMuTgUXEIT7Zd8Mewe9D/GOS16OfQtLZ DInMugi18k3J7JGMGLi/kaoIC7TvjeLcpgFAEnOli2t8R3eD4alxzia+jqf0Dle2y8oj 3e9xj9FpMyper6iI611gvwfDu6m75G/ZIHugy1HELn/uiGTqTyY8c3mlT5cbioYbpriX T1gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=XGdxXXks; 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 l1-v6si6596259pgo.377.2018.08.24.01.49.20; Fri, 24 Aug 2018 01:49:35 -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=XGdxXXks; 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 S1727386AbeHXMVW (ORCPT + 99 others); Fri, 24 Aug 2018 08:21:22 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38138 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbeHXMVV (ORCPT ); Fri, 24 Aug 2018 08:21:21 -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=W4K9GHyio6iakjM4D7I305435E1QN4Pp7/tITQv6UZY=; b=XGdxXXksplvMvTL3jjwhT0SlW Cnq3i2GZTTpLZ4UvaaVTYWtWLveLSqtzSAm94fJNJ6/6fQfY8lku3+RLzESsWO9NIjgxJQq234HTH 5xDEqCsLTFMzFDzrhP1MhRtwJZIG1ku1zqhUG9Qc4es/pY2R7qpA4Wqyi7oI9P1NM2IE/JlHbjSwi RDPc7Orb0tcQS0JwmtQI/hjtCGgAuzEdxFCXO/uH6Ghauo5vaOTB4myxS5yidH1NtxJbFDM3Sa3ER U80NBEgCVtyq3ZZkfbolqpDRYny5URW7VU8/XN/ZtV4xsOqVEgVzL/y0X8RIv+91Gh1hflcJmtTvj vpPZWr17g==; 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 1ft7kV-0007JV-7j; Fri, 24 Aug 2018 08:47:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0D53A202E65E0; Fri, 24 Aug 2018 10:47:18 +0200 (CEST) Date: Fri, 24 Aug 2018 10:47:17 +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: <20180824084717.GK24124@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180823133958.GA1496@brain-police> 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 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.