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 6058AC48BCF for ; Sat, 12 Jun 2021 21:48:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E317610CD for ; Sat, 12 Jun 2021 21:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbhFLVte (ORCPT ); Sat, 12 Jun 2021 17:49:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhFLVtd (ORCPT ); Sat, 12 Jun 2021 17:49:33 -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 94A8EC061574 for ; Sat, 12 Jun 2021 14:47:33 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsBTV-007RbK-Mn; Sat, 12 Jun 2021 21:47:29 +0000 Date: Sat, 12 Jun 2021 21:47:29 +0000 From: Al Viro To: Linus Torvalds Cc: Andreas Gruenbacher , cluster-devel , Linux Kernel Mailing List , Jan Kara , Matthew Wilcox Subject: Re: [RFC 5/9] iov_iter: Add iov_iter_fault_in_writeable() Message-ID: References: <20210531170123.243771-1-agruenba@redhat.com> <20210531170123.243771-6-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 12, 2021 at 02:33:31PM -0700, Linus Torvalds wrote: > That said, reads are obviously much easier, and I'd probably prefer > the model for writes to be to not necessarily pre-fault anything at > all, but just write to user space with page faults disabled. *nod* I don't like that write pre-fault model at all - note that unlike read we'll end up with atomic operations, etc. and there's a plenty of non-obvious ways for that to end up being costly, even assuming it works correctly in all cases. O_DIRECT case is a PITA - there we use GUP and there's no way to tell GUP that in the current situation we do *NOT* want to hit ->fault()/->page_mkwrite()/etc. pagefault_disable() won't be even noticed there... From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Date: Sat, 12 Jun 2021 21:47:29 +0000 Subject: [Cluster-devel] [RFC 5/9] iov_iter: Add iov_iter_fault_in_writeable() In-Reply-To: References: <20210531170123.243771-1-agruenba@redhat.com> <20210531170123.243771-6-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sat, Jun 12, 2021 at 02:33:31PM -0700, Linus Torvalds wrote: > That said, reads are obviously much easier, and I'd probably prefer > the model for writes to be to not necessarily pre-fault anything at > all, but just write to user space with page faults disabled. *nod* I don't like that write pre-fault model at all - note that unlike read we'll end up with atomic operations, etc. and there's a plenty of non-obvious ways for that to end up being costly, even assuming it works correctly in all cases. O_DIRECT case is a PITA - there we use GUP and there's no way to tell GUP that in the current situation we do *NOT* want to hit ->fault()/->page_mkwrite()/etc. pagefault_disable() won't be even noticed there...