Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4946087pxj; Tue, 22 Jun 2021 11:25:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDIVKaDZ/woPU68zeyW7sZ9BJyn4O+Ok/AwUKjA5LW2c0Ujkw3jsPuP+MGH332YQtdOdE8 X-Received: by 2002:a17:906:4fc6:: with SMTP id i6mr5442797ejw.472.1624386310317; Tue, 22 Jun 2021 11:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624386310; cv=none; d=google.com; s=arc-20160816; b=j7HrcD+seWSVZ3/+axvSBXKQvUnlpGkFKHGlIFftxJTJaJoatxMSa6hPUoxp1at+pq HreIBWhjoSLHS6DOSokDTFPJ2Hacb+jxujl9nd0dsvzR+o+m1PCNMpbKDQMZjYoSSk67 oK7G2iqtZGEdB2dvv+JGS5WlysXP8OUp4e63M90Ddvi+pASEBdq763iJj2Y2DKcp7Fjn DhbYTCXJHlb3PDAY7M32uINdeNI0FQZ4i+Fxzr5algLw2VB6vtz6hYvUHhYbJw7mj1aR 9IOzLy11DUm524bdBea+3JCEBxrCDl+ARaaKLIQyrN6ijmg/lYn3X4xndE/y44bqSC9w wAKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1i+51cszTri2Pv6HZYmqCBAao6nBfImeLdZrjWVU9oI=; b=iWoYc3TXyo4XWrhpEhg5R+1hHfrt/m+aa8W0FzWbnOKL9W31K2p46L/vOQKVzO+8AR H/GClL1rWUwdg9E3w71oHKwPhz57cGmcr9NVutIvLwGWkm1lFDTLPOFZBRBXY4KD/ka2 kaq3PdIEGfIdAfPpYMIoV1jUk874cip5IuNcZMDoP7jXDpL5zpCkCNRVVGUNNFlD3d1L MY3gmeDsYa8FB+/4hzsb82/zXTf8rcxau4FGcuzB3vwzUdhjX1pg17A1KPqL2/dSmALM rqbKLonH5oHTOvIGrbEqPHRRNj7v3VrkEYWyR0OOZqXH/Q673HQtTC6hlgurq6avjIe8 hoVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OvqyJ5NT; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si21504016edc.41.2021.06.22.11.24.46; Tue, 22 Jun 2021 11:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OvqyJ5NT; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbhFVS0Y (ORCPT + 99 others); Tue, 22 Jun 2021 14:26:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232453AbhFVS0X (ORCPT ); Tue, 22 Jun 2021 14:26:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33532C061756; Tue, 22 Jun 2021 11:24:06 -0700 (PDT) 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=1i+51cszTri2Pv6HZYmqCBAao6nBfImeLdZrjWVU9oI=; b=OvqyJ5NT5aiJLaAtcuhODvVx8r 2CU8kI2Vq62ueK5dcTXUbqE/rsz+6aovjex2JX/YcAGwyHWKkMbf+eN+AAtPAwKtVms9jefILxXPX 9AITgSGMMeXOir+xGZF7Zyz20TzMD+gZ7N4/yvD2wVdAsuo5IgrLsMpBeKzdRTItGNs6LYVSE9qcC F5eM9uw7klgR1l/aBEKY9ufwyqeyqa1hnPDStxhgxAoMEC5meh9Nrc0SCmZJCV9N9Lxzdm54K2/vY jVIgq4huUBENpA7JC6/DLw9CaAhoqhUdJgCGIrwTYzFseT/82ruPWDtAZB49Mrjky7xi6N2sSWrGf oSHaKPtw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvl3H-00EcNm-0Z; Tue, 22 Jun 2021 18:23:17 +0000 Date: Tue, 22 Jun 2021 19:23:10 +0100 From: Matthew Wilcox To: Linus Torvalds Cc: David Howells , Al Viro , Ted Ts'o , Dave Hansen , Andrew Morton , Linux-MM , Ext4 Developers List , linux-fsdevel , Linux Kernel Mailing List Subject: Re: Do we need to unrevert "fs: do not prefault sys_write() user buffer pages"? Message-ID: References: <3221175.1624375240@warthog.procyon.org.uk> <3231150.1624384533@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jun 22, 2021 at 11:07:56AM -0700, Linus Torvalds wrote: > On Tue, Jun 22, 2021 at 11:05 AM Matthew Wilcox wrote: > > > > Huh? Last I checked, the fault_in_readable actually read a byte from > > the page. It has to wait for the read to complete before that can > > happen. > > Yeah, we don't have any kind of async fault-in model. > > I'm not sure how that would even look. I don't think it would > necessarily be *impossible* (special marker in the exception table to > let the fault code know that this is a "prepare" fault), but it would > be pretty challenging. It wouldn't be _that_ bad necessarily. filemap_fault: page = find_get_page(mapping, offset); ... } else if (!page) { fpin = do_sync_mmap_readahead(vmf); ... and we could return at that point if the flag was set. There'd be some more details to fill in (if there's a !uptodate page in the page cache, don't wait for it), but it might not be too bad.