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 0ACAEC48BDF for ; Tue, 22 Jun 2021 15:28:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAB29600D1 for ; Tue, 22 Jun 2021 15:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232291AbhFVPaT (ORCPT ); Tue, 22 Jun 2021 11:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbhFVPaS (ORCPT ); Tue, 22 Jun 2021 11:30:18 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F80DC061574; Tue, 22 Jun 2021 08:28:02 -0700 (PDT) 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> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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.