Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5499648imm; Sun, 26 Aug 2018 22:01:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY1NDbPcq1E9gcx6xTCC0x1TfBALiKzcCFGpodQb57vQOZenk5MhfD9VVX+FjsfyfjWX+8L X-Received: by 2002:a17:902:528a:: with SMTP id a10-v6mr11398636pli.199.1535346104576; Sun, 26 Aug 2018 22:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535346104; cv=none; d=google.com; s=arc-20160816; b=LwXmSGk1Nn2si9c+zxBMwFDP0dyx4Ilg6QsqIIcNLNSnSPMQQ9HerpcW7cHX8S8YYt S76o+wPg2rWwItn9SGWF01tuCAubfPnJ6RmZy/45NTHPr+X51a3PIN0Fjc1zTadgOpVA kOZRtpyAVmmFncNuA5RkgVySyQdRql7zpzu1duKeXmeXI/J4GM0O2PH8zirptS8caInu wka7tecDfoDPmGNt2tit7keEzAnNn5BnqjQx36NjYbunFcx4eeA9MyvL+plb4g21Wo0r WZ8vr4Q73spZFjws/25ekLbSFo+S+Cht6vCvKLWC7G1ZXWlBg3pDRMqvgPe+gXaLlMYP 85Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=0W5GkKnnqzuaxaZW0JMMvOqsU441dQaVjtpiegSLEls=; b=E2lpnMvBGu9vUR2kMNIjpewEjZVUBVBJKtGTqG1q5c6oXkVWuvHAEkd9Lxom6uxpbv tlWY1q4DXojinVgZWhnUtgKTrj62eZ3TO/fQe9MOzzuAp3PGvplS/lple8mfB0/GDBVo AuKzS56rMjIQU25cIxBLkWYt4/86YSRVLhbN1CROIl5Ozya4/Rl/dxx9xP11TO3Coqap CNS5jZdtaKWqochlHgweyx41OREwoEq7d5v/N52RfOvTvxZSA3dHYhby0LqJJLiiYq6d cFDJUlNk4IBW448nb+bUr7TX9EYH+ZSxysDp60D3r/hpUqXvz+I7h2LlrKGQkGbUO3mo E6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dxR1PvEW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 199-v6si13874870pgg.366.2018.08.26.22.01.27; Sun, 26 Aug 2018 22:01:44 -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=pass header.i=@gmail.com header.s=20161025 header.b=dxR1PvEW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbeH0IpQ (ORCPT + 99 others); Mon, 27 Aug 2018 04:45:16 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37978 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbeH0IpQ (ORCPT ); Mon, 27 Aug 2018 04:45:16 -0400 Received: by mail-pg1-f193.google.com with SMTP id e2-v6so1423608pgv.5 for ; Sun, 26 Aug 2018 22:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0W5GkKnnqzuaxaZW0JMMvOqsU441dQaVjtpiegSLEls=; b=dxR1PvEWTTkvc4RbiAmmntv5FicpQFMuVUHjb5aqjXjK1aP7ob50H7bBFdox+cAxY5 KdaXJIaFXYKbKFSzxc/NR5LQDEK21KIKU77U5YUGwu/JKcanHUIC6lee43sEb5xHpM5Z 5d7syDJZoHwQrcvjBfPWRez6Ti5ZwgE/biQTLZUOD2TUnZlK/qQM1O1xy8tsz0rdfG/w WSf9R4s08KGfcLBRyB/c3j2LWsn1jxcW33o/cGI9lEURH2JDvjFMVmD8iqTqp5CRxWop F2j0+/yatjz7Dsf0+8Ixcuw6l3yWYhOrv2YKPmWeg0R3p5ufn6m1YO/nDxHKpbsmIUlp nEiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0W5GkKnnqzuaxaZW0JMMvOqsU441dQaVjtpiegSLEls=; b=KBMLmGwyWyYDrLajm3AQxyQIqqBQDVs2ZuaDyl17Cp7QuoTtbMjOlDcStAbk57luhi CsAEkYKkRR6HSBx51yic5Ad1TaTX+g+932fSbgtbWqpPIaSEhWJqpC23VpIVdkm1qIbr eMfPiHCxpMoXj2dhvuLX4QroxEDDiO7gHxAAuzTOx3xLnVWFIQsNmePaKj4z/vt9Eocf dGrrG7Es8KfbP92wOYuFEVMDtsbOUsUpN0W5npM67U5tdtzjVhZSG2+uXz0TLonFlmxu MrgHAuzJSxxB/7siHkptLLgH7qGz25ipPNzxrTesyzFnzI7yEKKeMXffavdI/b5fIGLI 9r/w== X-Gm-Message-State: APzg51BN9ylt7/YBUX1Ax+3OI0XSh1VWhm4Y2nUjOrBB7nwGUdL8ZCaN DxPyq3pPOH6htujTFBX0Gd8= X-Received: by 2002:a62:9ed1:: with SMTP id f78-v6mr12724658pfk.206.1535346016991; Sun, 26 Aug 2018 22:00:16 -0700 (PDT) Received: from roar.ozlabs.ibm.com (59-102-83-192.tpgi.com.au. [59.102.83.192]) by smtp.gmail.com with ESMTPSA id r23-v6sm20392894pfj.5.2018.08.26.22.00.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Aug 2018 22:00:16 -0700 (PDT) Date: Mon, 27 Aug 2018 15:00:08 +1000 From: Nicholas Piggin To: Peter Zijlstra Cc: Will Deacon , Linus Torvalds , Benjamin Herrenschmidt , 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: <20180827150008.13bce08f@roar.ozlabs.ibm.com> In-Reply-To: <20180824113953.GL24142@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> <20180824113214.GK24142@hirez.programming.kicks-ass.net> <20180824113953.GL24142@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Aug 2018 13:39:53 +0200 Peter Zijlstra wrote: > On Fri, Aug 24, 2018 at 01:32:14PM +0200, Peter Zijlstra wrote: > > 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") > > Ah, good, it seems that already got cleaned up a lot. But it all moved > into the power code.. blergh. I lost track of what the problem is here? For powerpc, tlb_start_vma is not the right API to use for this because it wants to deal with different page sizes within a vma. Thanks, Nick