From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0E6BB67A; Mon, 17 Mar 2025 00:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742172633; cv=none; b=f4n8UUU4ZH5lbGgHVqVK7lZovBPq38RBNOEB9u/StO2Lr0EutYJjdVdrNySE9uaNyAMvf3bbnYedmFVD7MX3IAklqi6OMeqSzNYkMByvycIszXk76Ou0vjByNB6XeHk8GC9IQkmQGrOLSpwFBiGOfKeNx5EN23GTqEK18SI0Z4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742172633; c=relaxed/simple; bh=/AOSe7aq0nChqdQRh86alo+MWwYHvaes5E17kFYiFIA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=qjum72+3SMt1hyWy6DC3WNWIsEPQwcFSeIxz8zqCR90RaICJcrxgVrprSUllxNUANSK3WQN4VAtQj0est+5XRLWoxABmx7yX07Hj6yIn/oMtnogQeELW6Xix4KEZOS5ytP5HpxxYWI3A71YFAUEsq5jKaKgeID+Cvu/55wDZ3bM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=mpzZndO/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="mpzZndO/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF3B7C4CEDD; Mon, 17 Mar 2025 00:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1742172631; bh=/AOSe7aq0nChqdQRh86alo+MWwYHvaes5E17kFYiFIA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mpzZndO/iEMbjsNstWhXiw29qloZefDjGCjbdLzVbu8AWoIP3rbYu8gvByPEebqZO NQ94QS0uXpMoe4gHl20GGVqOEHi5wEnf+zVu6U5DIoTK8/zhixuSeyc7J4gmPPZhtv jLgyPg2YA52XiVmTXCDcz7B6AaOcaYYiNRKZnq6w= Date: Sun, 16 Mar 2025 17:50:30 -0700 From: Andrew Morton To: Hugh Dickins Cc: Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jann Horn , Peter Zijlstra , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , linux-arch@vger.kernel.org Subject: Re: [PATCH v4] mmu_gather: move tlb flush for VM_PFNMAP/VM_MIXEDMAP vmas into free_pgtables() Message-Id: <20250316175030.e929cab808c976995ec662b2@linux-foundation.org> In-Reply-To: <61e3ea6a-368a-640f-a050-b56c8d3232b5@google.com> References: <20250127195321.35779-1-roman.gushchin@linux.dev> <61e3ea6a-368a-640f-a050-b56c8d3232b5@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 27 Jan 2025 12:55:11 -0800 (PST) Hugh Dickins wrote: > > Fix this by moving the tlb flush out of tlb_end_vma() into > > free_pgtables(), somewhat similar to the stable version of the > > original commit: e.g. stable commit 895428ee124a ("mm: Force TLB flush > > for PFNMAP mappings before unlink_file_vma()"). > > > > Note, that if tlb->fullmm is set, no flush is required, as the whole > > mm is about to be destroyed. > > > > Signed-off-by: Roman Gushchin > > Cc: Jann Horn > > Cc: Peter Zijlstra > > Cc: Will Deacon > > Cc: "Aneesh Kumar K.V" > > Cc: Andrew Morton > > Cc: Nick Piggin > > Cc: Hugh Dickins > > Cc: linux-arch@vger.kernel.org > > Cc: linux-mm@kvack.org > > > > --- > > > > v4: > > - naming/comments update (by Peter Z.) > > - check vma->vma->vm_flags in tlb_free_vma() (by Peter Z.) > > Let me just put on record: you were absolutely right not to extend to > this the Ack I gave to v3, this v4 is silly (tlb_free_vma() and its > multiple calls, necessary only because of the unnecessary extra test); > but I don't see it as doing any actual damage, so I'll stop short of > NAKking it. I think I'll just drop this. Let's revisit in the next -rc cycle, if Roman is motivated.