Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6261720yba; Tue, 14 May 2019 04:46:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5w0B+9YeSHgFpqGhNsXWj9D3+O5ZrbpolXE5jdWtMYSVvC6m25kckynf7Bj+MsKWgV0bJ X-Received: by 2002:a17:902:e00f:: with SMTP id ca15mr37586572plb.76.1557834388847; Tue, 14 May 2019 04:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557834388; cv=none; d=google.com; s=arc-20160816; b=jNAJEZEcYp61jBXWp22mKDjl5kQ4ZDiCHYteOfcsIMSPrANf9CShaiVQoi+Q3tOQIl vGH+jBqSGj03t0TJc9R6zU/OwbWamso6S7qC7rOqhh4nqGaJaQMHE8ipnhvY+O5F7k0F VUMD52TTpPMEEdSYPHEiwAUxS7MkahH+8Ef85EDmkNA2Smwq3RbjyaO365woXFyRUR89 Myz/fqK8NG1PObWAWVSSEwhLh5zHOuS58A8ckxI7BgHJIREHNLC/lQO0o+2pRMj/FLRN YqZmkWWB0zkSpBMQOdzFT1G+SnGy1McZcu/9IDL4w6nh1wGqrTa/eIjo/upruBGFVtg9 3byA== 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; bh=BhD3OnVLQKwBnDmageAbFQrzsjIjd55x6Z/qXnxU1kc=; b=qrOfIikegDhLb5rXA1D8D3pInLTl5t/U07XWZfIx0WK/bf/78DMXh93urRS9pcMc7K NajxU/Knp8lEl3gm6U51YUrZ1qcUeGcU3rQ9t2xy2qKDdgD07nXHPyBM0fCmNxT7hLT5 HFNp76TkE5YSWN1bzwweiz6a/bqTYpt0G3vUJAnGonstGcFha8rqnIr4mLvpQ/DXcMc3 ++RSvji3fVJhL5TVxxhOWAoGw2deyUPU0xn1HgNvmjJXYlhzInsVl8163w4bjGUtmIIN 2qRgTjQzT6uhS5quhGAuD3mZcuthIT6sQ+BHJRlnGDb6o2mFAeITX+GNqCY/W7H3WjJH 6f1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=OcAcBuO+; 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 1si20878145pgx.176.2019.05.14.04.46.13; Tue, 14 May 2019 04:46:28 -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=OcAcBuO+; 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 S1726281AbfENLn6 (ORCPT + 99 others); Tue, 14 May 2019 07:43:58 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36168 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbfENLn6 (ORCPT ); Tue, 14 May 2019 07:43:58 -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=BhD3OnVLQKwBnDmageAbFQrzsjIjd55x6Z/qXnxU1kc=; b=OcAcBuO+E2YaqxTh3wmNWEvgt 2g29keOO2R7/iXEpa20Ny/fs7AIjc/V3rlYKvWyJ61CCBW5dDp7aRqQVXg/upu4BdfdrtNfW5sDmx DwyT4egWskNMSnKAovv3pM52FDdLby2NbIqXpuKIG5a6XdOtPlCDgCBJLlndATU44YwRY8ZUAnMFv EFbhmIs+bNDjyydTm6CYE1cHqnX3nCrIL18yxSjPeNmgpLuMJ8TXgETsY23iduPliKI/nC4uLiYDy vYGNTdy6oga4h32Cv0/AFpgyMz4F4dpmGQ/V3d5gz9MPIux5zNPOABopjcu1/56rtQNUuPj/h8U1d 3Ab6xsRhA==; 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 1hQVqT-0007fJ-Vr; Tue, 14 May 2019 11:43:46 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8D0FC2029F877; Tue, 14 May 2019 13:43:43 +0200 (CEST) Date: Tue, 14 May 2019 13:43:43 +0200 From: Peter Zijlstra To: Nadav Amit Cc: Yang Shi , Will Deacon , "jstancek@redhat.com" , "minchan@kernel.org" , "mgorman@suse.de" , "stable@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [v2 PATCH] mm: mmu_gather: remove __tlb_reset_range() for force flush Message-ID: <20190514114343.GN2589@hirez.programming.kicks-ass.net> References: <45c6096e-c3e0-4058-8669-75fbba415e07@email.android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45c6096e-c3e0-4058-8669-75fbba415e07@email.android.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 02:01:34AM +0000, Nadav Amit wrote: > > diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c > > index 99740e1dd273..cc251422d307 100644 > > --- a/mm/mmu_gather.c > > +++ b/mm/mmu_gather.c > > @@ -251,8 +251,9 @@ void tlb_finish_mmu(struct mmu_gather *tlb, > > * forcefully if we detect parallel PTE batching threads. > > */ > > if (mm_tlb_flush_nested(tlb->mm)) { > > + tlb->fullmm = 1; > > __tlb_reset_range(tlb); > > - __tlb_adjust_range(tlb, start, end - start); > > + tlb->freed_tables = 1; > > } > > > > tlb_flush_mmu(tlb); > > > I think that this should have set need_flush_all and not fullmm. Difficult, mmu_gather::need_flush_all is arch specific and not everybody implements it. And while mmu_gather::fullmm isn't strictly correct either; we can (ab)use it here, because at tlb_finish_mmu() time the differences don't matter anymore.