Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4935113pxj; Tue, 22 Jun 2021 11:10:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4BoauEukYLthW/l9tblqmhN9ln6YvhDDpg44WWnb51jxPNkNKgPSB0VelLP8jnoV2HRUx X-Received: by 2002:a05:6e02:c7:: with SMTP id r7mr3558782ilq.76.1624385407167; Tue, 22 Jun 2021 11:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624385407; cv=none; d=google.com; s=arc-20160816; b=0rNsXHBW29/MV2RtUoqTyfE4QebBYHk2OJCy7tROCDWE2K5TlhSSdHOeAOflME/Ue+ wqHa5onnzPRNkMJnLQA4laojuWlOAZpEXUnWPmWk041WGa4X+M6VTTRpZ9YjZmds8zWr G+tuKWDNEMdAT5QElkiZrNLzMUBqPDgjNmCMsltFAJjPC5k1gdljx5p63kYxsX2DafeW DplNWn1ca8iXm9GS2GEzDWzNWnj+KbXSIXG8NBoo3OOZkf9coG/QohPRSYmv6wl8avRh jSZm3MlqjZqtemQgDDI6USgCcoTjbCYE9xGTmwNO/vYRRp/AFpu+8zX6VggP50dcivUU h/Vw== 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=4u1NCyaAJJ8fxeYpU8Gk6l5XhQlmfpxfNSoBL7x9hjU=; b=U+TDhWMQ9Ql/Tfuhls6HCqBotnrrxFViXxb8btiBGh9D5VC5X9rLD7ChRanK6P6ywy g1rieWzeqH/JhT0pllhBWT46nq3PF8015J1J7Ji6ZtWDsNH0oPdIhgWEtTiwGAn9YGTR gYwM4uzCPywJ7vDnbuJHEio7YC/438JZn50OUevu73Vj6aU3II2eM2+xXXnWJX0DfcQK oS4QpNLgcLJOBsmcV0vFBYCRWM8okJa4I7UNfQxn0XaPXo4Vf/49Om0vfxZaTXj0BHGg ts1yZ2gkCc5AHOeCLbq2/I/MHbGPQO6q0DtGV5batTQqQ2FBraeqPGkB3rQVaw6m+Nw9 ICkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aJ7Lp27q; 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 c19si17244976ild.65.2021.06.22.11.09.50; Tue, 22 Jun 2021 11:10:07 -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=aJ7Lp27q; 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 S232938AbhFVSLb (ORCPT + 99 others); Tue, 22 Jun 2021 14:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232630AbhFVSLQ (ORCPT ); Tue, 22 Jun 2021 14:11:16 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A45C06114F; Tue, 22 Jun 2021 11:06:10 -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=4u1NCyaAJJ8fxeYpU8Gk6l5XhQlmfpxfNSoBL7x9hjU=; b=aJ7Lp27qSS9eU0YVfkFs/6IM+l vOm9pcgy0M/v1BWlSBTFWibCJsqiIsGsH2Ikhl8ZZw18gUkZAT+TqJjWv6rWzGyB9kKoRihWKBFuE YON+ElnCJqFLFsFWHpf16nUklwXeXQaaEIrhxVJXUdCNKfXCf/1t3/V55teOiZMhGZBHaKGv+vZOm G6vMCqeL4lpnDdWmPsTdyeTODow4zPRM28Rvm3cUCNXEm2U+K9RprOiDEr9bK+gpGqNoFmzDYQHCn ne9RPTW7I0nHh3L6B3BftRe5xspS9jEKwG2DCx/j3F2RKbrNTEtwvmCV8uglJSefFA5siLrRs45t9 UeMqdmuw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvkkk-00EasQ-G3; Tue, 22 Jun 2021 18:04:26 +0000 Date: Tue, 22 Jun 2021 19:04:02 +0100 From: Matthew Wilcox To: David Howells Cc: Linus Torvalds , 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: <3231150.1624384533@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jun 22, 2021 at 06:55:33PM +0100, David Howells wrote: > Linus Torvalds wrote: > > > End result: doing the fault_in_readable "unnecessarily" at the > > beginning is likely the better optimization. It's basically free when > > it's not necessary, and it avoids an extra fault (and extra > > lock/unlock and retry) when it does end up faulting pages in. > > It may also cause the read in to happen in the background whilst write_begin > is being done. 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.