Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp411684lqi; Thu, 7 Mar 2024 00:26:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUfAuV1Hpg/QlYJrSFd+MT/5/Zng/sW3VPUVeCcrVNd5o9pkkVDItbLmmDgxSbuxTjiVZPycFK78jmYvAd7mWM/OdXiTe0M8fsLkgEvjg== X-Google-Smtp-Source: AGHT+IE1uTc62Y5+W/QYG6zRqejQpdXaXj8D3h/GScvkga7JqA+Zu5k3Dy+JeirDGo13dv1Wi3iT X-Received: by 2002:a05:6402:3112:b0:568:93f:36c0 with SMTP id dc18-20020a056402311200b00568093f36c0mr1576979edb.39.1709800014604; Thu, 07 Mar 2024 00:26:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709800014; cv=pass; d=google.com; s=arc-20160816; b=hwAnDs15NW5/rC7jsWwbZSPamBYR+7ttEk/JA4d3Jpo8LaeqCCwdfb5O4ek9zMsYLJ F6mE+UMRYgDCh0OWMLA0gEALS1mThKrdVcZDXmivq2X973RfSpwcSAZcHD7E4w2Zg7Cm lMkHgTmqjRHWvcS3cwwvA7Awv9gs3jEGY9AeawZiXO1kOiN65EuneA4loAh0eVHDaqMP DGKaiFEAdR354SDnjUgTweti/ZCx1nx6QGhzbt5Xaq18p/TUazsC9b01DL63MMLJGgzY ecQlcUTCrx6rkBhcgvZ8Qa4lHlR19AgPmgTht+vMsXcxMzqFkj/9Ai+K1JNbgVmtdT+t ScIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :references:in-reply-to:from:organization:dkim-signature; bh=GNYFlX4GZ3sigkzX5bE6FkuPu9beg0e7HrY2SFlhQWw=; fh=kHlREoW5gVROAwCyLcWYd/OubaPjZSNY4b8X+ONEUV8=; b=KxIssGAgaraXO67ro7whPH4HeXn2LNk0LmUCn8Di8K2+b2SVhox0vG0n7Lg0boUCBI aTS/GohlbllBvQasqDz/zYLtC24nhlld9PR2I84DVswO1SCy1ouPhft2rgml66qruwuC TG7VQqXsSUz9Lw+4c+xOG0SbVHxNuXJnCo/AGyCFsZBowGvDjiDOlDsvasu7e5JQbyYy 2Arw+chrLL9f99af6zH6uoPvWPyIOyfWSAMy3ooskMdvfjzyRoX1BMnI3rDxpiFLvSo4 1zgZaE1bqrDtDQTWaMHcAd1QepKzKRidih06tvD3v02T62zS1IBHYkVpVI8lWkyvsx56 QdOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7M2n6+E; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-2225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fd11-20020a056402388b00b0056818eaa3b6si303633edb.541.2024.03.07.00.26.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 00:26:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7M2n6+E; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-2225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 17DD41F21C30 for ; Thu, 7 Mar 2024 08:26:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E323F63408; Thu, 7 Mar 2024 08:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="D7M2n6+E" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0B3C663108 for ; Thu, 7 Mar 2024 08:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709800011; cv=none; b=EdTTisxj5KL6nLDwfUa/quqau0HDqhNma2hvOj7i0K7rxcEWUsRiB8pH7tRueLuIcgK28kE+M2fS1PtOqcDYcG5LbBM448YlIlMtRQ1Cb/hnKaOIttyVwpwKLXCkABaSwHbZ44I2mVnVoEhnPIeh2WdwM3etecZL0ev/InrGST8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709800011; c=relaxed/simple; bh=GSLLGWd6A4v0+iH8U2RooYpIV7bjKBaVVn5koXyUZhs=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=m9yFlRptqnTeA+vDfZxQZ0ImJbZzAkAYrW+Pp1Efh2GncwmdNhkmxHJxgfS2iOzi0AWvYk79NYqn7nO0vwlIPJmiMgpZ+QcdsPIXTmFhqnA6tebq3J7ZucOQ+CwUjYBIRO4EzG4Q2l1tmaY1q8acM6zP7Ln4OwqvLBkxzNCpPRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=D7M2n6+E; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709800008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GNYFlX4GZ3sigkzX5bE6FkuPu9beg0e7HrY2SFlhQWw=; b=D7M2n6+ELIkA/LpEb6DVjp1eWj36HncEC6hLeIMsmQS0uvIrD0X0cTc6J34kd/qO4FoMKw 1pSMTz0LgDii0RoL+RVGJpr69xKg4cWq/dGKB4lFPf7xtxCyvnXQumgp2DRB1insrDncOJ FFtvOtSOPaqFZT4GjsLTAETeCBKbOwQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-YCH9Z4zEMva3JJyiGTu8eQ-1; Thu, 07 Mar 2024 03:26:45 -0500 X-MC-Unique: YCH9Z4zEMva3JJyiGTu8eQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A97D91C006AE; Thu, 7 Mar 2024 08:26:44 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 177F9C37A83; Thu, 7 Mar 2024 08:26:41 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <1668172.1709764777@warthog.procyon.org.uk> To: Matthew Wilcox , Trond Myklebust Cc: dhowells@redhat.com, Christoph Hellwig , Andrew Morton , Alexander Viro , Christian Brauner , Jeff Layton , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, devel@lists.orangefs.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm: Replace ->launder_folio() with flush and wait Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1821329.1709800001.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Mar 2024 08:26:41 +0000 Message-ID: <1821330.1709800001@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Matthew Wilcox wrote: > commit e3db7691e9f3dff3289f64e3d98583e28afe03db > Author: Trond Myklebust > Date: Wed Jan 10 23:15:39 2007 -0800 > = > [PATCH] NFS: Fix race in nfs_release_page() >... = > invalidate_inode_pages2() may find the dirty bit has been set on a= page > owing to the fact that the page may still be mapped after it was l= ocked. > Only after the call to unmap_mapping_range() are we sure that the = page > can no longer be dirtied. Is that last sentence even true? It evicts folios from the TLB and/or pagetables, but it doesn't actually trim any mmap made - in which case, userspace is perfectly at liberty to regenerate and dirty the folio the mo= ment the folio is removed from the page tables. Otherwise DIO-to/from-mmap wil= l deadlock. > but my belief is that we should be able to get rid of it. I think you're probably correct. The best we can do, I think, is to prefa= ce any call to invalidate_inode_pages2() with a flush-and-wait over the same range. David