From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FCF4C2B9F4 for ; Tue, 22 Jun 2021 18:24:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1E20611CE for ; Tue, 22 Jun 2021 18:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1E20611CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E4D2A6B0071; Tue, 22 Jun 2021 14:24:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E247D6B0072; Tue, 22 Jun 2021 14:24:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEB936B0073; Tue, 22 Jun 2021 14:24:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 9E9A46B0072 for ; Tue, 22 Jun 2021 14:24:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C801D180295A6 for ; Tue, 22 Jun 2021 18:24:00 +0000 (UTC) X-FDA: 78282183840.03.4309918 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 441F0801912B for ; Tue, 22 Jun 2021 18:24:00 +0000 (UTC) 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: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OvqyJ5NT; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 441F0801912B X-Stat-Signature: fjfpxuuciockds1o4hmix4w7qpu5kjia X-HE-Tag: 1624386240-852781 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.