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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 889A6C2B9F4 for ; Tue, 22 Jun 2021 15:28:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 14480600D1 for ; Tue, 22 Jun 2021 15:28:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14480600D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EA2B06B0036; Tue, 22 Jun 2021 11:27:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E79A26B006C; Tue, 22 Jun 2021 11:27:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D41E96B0070; Tue, 22 Jun 2021 11:27:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 972B66B0036 for ; Tue, 22 Jun 2021 11:27:58 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CDE9C1AA65 for ; Tue, 22 Jun 2021 15:27:58 +0000 (UTC) X-FDA: 78281740236.06.F152086 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf14.hostedemail.com (Postfix) with ESMTP id 58A43C00CBEB for ; Tue, 22 Jun 2021 15:27:58 +0000 (UTC) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lviJT-00BEGJ-Qu; Tue, 22 Jun 2021 15:27:43 +0000 Date: Tue, 22 Jun 2021 15:27:43 +0000 From: Al Viro To: David Howells Cc: torvalds@linux-foundation.org, Ted Ts'o , Dave Hansen , Andrew Morton , willy@infradead.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3221175.1624375240@warthog.procyon.org.uk> Authentication-Results: imf14.hostedemail.com; dkim=none; spf=none (imf14.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 142.44.231.140) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 58A43C00CBEB X-Stat-Signature: 8roqseeeymqbdm3trqawrm56pa5dc41t X-HE-Tag: 1624375678-215181 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 04:20:40PM +0100, David Howells wrote: > and wondering if the iov_iter_fault_in_readable() is actually effective. Yes, > it can make sure that the page we're intending to modify is dragged into the > pagecache and marked uptodate so that it can be read from, but is it possible > for the page to then get reclaimed before we get to > iov_iter_copy_from_user_atomic()? a_ops->write_begin() could potentially take > a long time, say if it has to go and get a lock/lease from a server. Yes, it is. So what? We'll just retry. You *can't* take faults while holding some pages locked; not without shitloads of deadlocks.