Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2208992lqb; Mon, 27 May 2024 11:17:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0UYEVmfgXQNaj/XTb4LwSNKxKn5LhjUXoXm/QF3VhBQOwY9Hohj2yNU6ZfUZG2apLitBDT5S+Ta85T9yDQgcF39IoNgN/4nHCSJrQig== X-Google-Smtp-Source: AGHT+IHMNJG+Zk67uX6TxDE3cIAkhYXN5GmFC3GvcDZx7J7TMPWK2JwSnEUPOr1YoXWryGSFyvOp X-Received: by 2002:a05:620a:4ad1:b0:790:c6ef:3d0f with SMTP id af79cd13be357-794ab0f48a3mr1123493885a.54.1716833846559; Mon, 27 May 2024 11:17:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716833846; cv=pass; d=google.com; s=arc-20160816; b=yEL7uQP7gpt5o0SIV1Te4j8gdPfOb+zY9cT6W9/jzeTgcmI+FYILGvkJTvb/m8ZqQx KXqSrXDaDOvr/Hb7XHpUxLOyYehftKEtXsjMDEd7CPwhTekblBTT1mIA/axDseigmWFk fEy3fR0Hejh4rr8+hLdYKJh82aj5ZvMJSCbdicB+jUihDe18vniKvJExwHrnl6L2JO5K v16Kd46Yj9tO/E818frSqv606zxNZ6CYjZVSZloRoEN5Z5j2p81Ikz1Z2C3QEEAdn/iO dftkVmZReW2IvhKPNPWgqrKK89YbpylEnbyaWtj8Y/iSeiAY+nCEgWJmPcUYWSGyj/AH Ci3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yQPndnt/VKkoxE+QATcqk3pffHAGhUlkEJl1EekOfS0=; fh=jgotHe3n9bSvUUqViLCrEcHmuySCZvE4HsIL2r/mw0E=; b=IEo4+0dGYExnxvG53bociVI0QEFFAKL8khsWTe2uCE6tYQJif5OPIAWN/0PReA55DF yWjjazt81Iz7eMfx5flfPUoypmcl+usZQJXXElLDoxc3s5PXiI/51mTU8p2sZKIWaJCA PCSCLbdcve4EPrT0X3Srui7fUHqTDzypxZvthmxSwWS1GGlUCtv7DYopcTFEmh+x539k JdsQ7oV5YA6DYid0u25hIIaVrMm5hFMdP0N5dAV3l05cx1cQRcj0Sxm8/XgTixq2Oqs3 gYsHdXElSSHGaqSi15KyBogXrCVXgvi3qCsIchc54ekMqYyUPadDSKcgvisiq1w2TL8Y mI+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="EBoD/Hrh"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-nfs+bounces-3424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3424-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abcad9ddsi904047685a.68.2024.05.27.11.17.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 11:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="EBoD/Hrh"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-nfs+bounces-3424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3424-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 49DAF1C220AF for ; Mon, 27 May 2024 18:17:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35DF161FD2; Mon, 27 May 2024 18:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="EBoD/Hrh" X-Original-To: linux-nfs@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 7D4C01DA23; Mon, 27 May 2024 18:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716833843; cv=none; b=TgMJXZGBrUdDnaJMEyYgwlNCo1zs9i7I2nEL3Kv+O7pySw5P35wg607CqiwswRtUhFIih9lMZSGVLeO702PK3VQov4oXA6PUx4ugTF3bCeUYqyi6dAuVrPEz1fZlecaOX2jgcoTykOAwRT1Jud49iWAlXCLDp6PoDVZtCFc0fgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716833843; c=relaxed/simple; bh=73l1YPr/2J7LXLM4NzJGlrHdLbkHv4cNTEwSMSwytdI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bkJcHLodrcMgh7Y4trPt/IdGSec+XjkKuGyVZf2+eLsTFDeOwAINykeCxtKZcBuvfzcm4C38ozPYIADCL3AMqB0/xU94118uRSFljvV/WJgUx8l3LnqIQoN+V1Mha7/u5Eqz+DPITMfPueuM+ZR35n6hwiuF8WPFu9wOROXbpbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=EBoD/Hrh; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=yQPndnt/VKkoxE+QATcqk3pffHAGhUlkEJl1EekOfS0=; b=EBoD/HrhhFDFz4F7sBZCAVQPZ3 UdPROiG8LxqhGX4WRjDUOkrv/AG5V/dDZE0KCq0UT1U7xc+ygKs4+n3RfQWs8xwEgBIopsRAC1BlN +pbsBC1Eqdkk7Lv06FUj8iLILqJU0qpqWZ5U0J3gRjRvqWmtfvof0zSHvb4fHqbpM5exeJeN9G3uC h8hH6miNT4tf4zY0nvd6MDPJ15+dPejJTPhb3OPZy4JGs47OgDCjbvNVsApJ+87WwHo/jarDC3uiO Nq4q6dA9H4UtVIPaE/oDcG7YAc7YUnK325Dpy7hgiSKfb0jLGQrZZWdMV9bvuI3JS1licFjcnRc7V apptAnSA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBeuM-00000007sZU-0Y5G; Mon, 27 May 2024 18:17:18 +0000 Date: Mon, 27 May 2024 19:17:18 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/2] filemap: Convert generic_perform_write() to support large folios Message-ID: References: <20240527163616.1135968-1-hch@lst.de> <20240527163616.1135968-2-hch@lst.de> 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-Disposition: inline In-Reply-To: <20240527163616.1135968-2-hch@lst.de> On Mon, May 27, 2024 at 06:36:08PM +0200, Christoph Hellwig wrote: > From: "Matthew Wilcox (Oracle)" > > Modelled after the loop in iomap_write_iter(), copy larger chunks from > userspace if the filesystem has created large folios. > > Signed-off-by: Matthew Wilcox (Oracle) > [hch: use mapping_max_folio_size to keep supporting file systems that do > not support large folios] > Signed-off-by: Christoph Hellwig Yup, this still makes sense to me. Could you remind me why we need to call flush_dcache_folio() in generic_perform_write() while we don't in iomap_write_iter()? > if (mapping_writably_mapped(mapping)) > - flush_dcache_page(page); > + flush_dcache_folio(folio); (i'm not talking about this one) > - copied = copy_page_from_iter_atomic(page, offset, bytes, i); > - flush_dcache_page(page); > + copied = copy_folio_from_iter_atomic(folio, offset, bytes, i); > + flush_dcache_folio(folio); (this one has no equivalent in iomap) > status = a_ops->write_end(file, mapping, pos, bytes, copied, > page, fsdata);