Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4809397pxj; Tue, 22 Jun 2021 08:28:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQuBPccoAm7+p6Pg0gNtXOch6EMmV9rEq1MXY/C88nuMXm/0qZng8Q5HeHsxcN+fwsQ94J X-Received: by 2002:a05:6638:13c3:: with SMTP id i3mr4530020jaj.140.1624375713284; Tue, 22 Jun 2021 08:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624375713; cv=none; d=google.com; s=arc-20160816; b=WzwAWTj9EyK1cGUppF4Ivtk/4iZIBUg/46W6v0BRR6Dp62GaU8rzOXgZv6Elq0UoBA c9R1Z9cj70yphQTKiEjLU8z0VhYD88GWmprNlmk3yMZ5qm7kHR9ve21NzOpxtD2VJ0NA Q8sKOwwY8qNXPI394NTqubpPnNf/3bKEuZzrNYYcezg8CreEARGQ0MfsO7FGoYolv03G cxmXk1dreLdAZvjT23FK69LPdBgMvY26SoVwN1CTyB1RJlckc5vdE+XnSaSiktSPF3zN ZSUG9IAvHqm/tIr8EidTzkpj8z+qNwCWrTbjEFczBErqLEPstPIQg0zTRk/nOSTTm1vm 0Dbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ppFdsSDqaGZf7grKK10wYAVyR3G1ZPfu7qSNmOIar6I=; b=ahoIWJnCwBLj5Q/Upuaf6Lxe9adgyrU8UxOgpU2Q2ojkCNODcYrkEUF9op3DuwROXI 6eiH+YqQNYvJqPhliiOTIzkxM+KCO7iVodlJ51P9HopdkVfEcES/voD43OUGTAvl1k9P UjntmRcLEgxX+NM8rsf2oEdnSg9IcyY1/ZPIINt3GThUIzkffo3CPNXccfc9E828rRYk zIvgZC16vDSct2B/RcwX9UEI1VDz7bp10SYvXbrAPL8z8IAv52AyzZzB2fIqRfGeygHB +1XOioKt4FjBKmptbTpJtiX2iA/UYLT/G5fHxqlkYi1J7ONry2Kko/8nek3sP/7//0Rs D02g== ARC-Authentication-Results: i=1; mx.google.com; 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 g12si16577083ilf.112.2021.06.22.08.28.20; Tue, 22 Jun 2021 08:28:33 -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; 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 S232261AbhFVPaT (ORCPT + 99 others); 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-ext4@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.