Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp680158rwe; Wed, 24 Aug 2022 07:25:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yY0W2Y/TGf9olnwbJaWE/fJ6JQ36ZtNKWrKcoGH0KB0BP9lyKmIRrgsZ6swNE3dc62nnH X-Received: by 2002:a05:6402:241d:b0:443:39c5:808b with SMTP id t29-20020a056402241d00b0044339c5808bmr7827109eda.39.1661351126082; Wed, 24 Aug 2022 07:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661351126; cv=none; d=google.com; s=arc-20160816; b=lUcLJSIuUfongq3HMZ/IijtHbp/4yH44q/Dz4/JECNlEVsSOtZmPYwSPxa2GFSMWj3 qMtVmE0z3EaAstPIeJS+dKe0XiQecWQrS5r5AULYwdqvE24EPSRNFusXIVPHNXps/78n dppsrguMnFOVmo5VCxHHB8TYIWnCCmaLnK5s87FzbZ8FUjEh8UFWnICiS7tnQMaojg0P ynwg4iBiPhhaviGy/ShieaFrWLJHCn5AKCYnxy6Vielx8yIEYaPj/DtC2gZmFLGj+Y0t +YdwxBE6KcytBAqTJSIMJTnT483lV8kxnZro4d1L/TW/TkQykqCIoiPfHefFONIL+E8I gSAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=ZC3oEnAgrPArg0xVvoyGc9cfB1DwXksHlrLAbVloG14=; b=FLXxuOuptwdjpRyKMqcvfd24Ff4zTPG2JoGlMiTdyuZrE/QdRCGZVLDi2CNvJ+TeSH LJCvbOVSVdRoRnlBJh0XhmxCBsqWIdW61l/bLeiRLQul0D2eJbWYONOLDp8qwEPG4Adp Lt2kOUg8RtG7/VlK0gAhhogp6l47nkIEeKwqb9WXjT4TAxe1t/Qr/XxVF/8U3iMEjgwg QU0X5WzKwepbd2SiXKL5LGI+9FhlekiKPyqhJ6XoPwso9qKT2h8Y9QnWTrC9elR+c8qI MqruRdpM0uF3oLAP02sbb/Xrah5m0nUMBPC2hkJv+nd2zsJe/TiXvAwGLkEMwgmLVDyU vQQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OKHIwVKX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kt27-20020a170906aadb00b0073cfa9b4286si2290757ejb.648.2022.08.24.07.24.57; Wed, 24 Aug 2022 07:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OKHIwVKX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236392AbiHXOMP (ORCPT + 99 others); Wed, 24 Aug 2022 10:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236086AbiHXOMN (ORCPT ); Wed, 24 Aug 2022 10:12:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43517F0A9 for ; Wed, 24 Aug 2022 07:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661350330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZC3oEnAgrPArg0xVvoyGc9cfB1DwXksHlrLAbVloG14=; b=OKHIwVKXfvnj/FKdntU5F0NShihOvYxDJfMf5SPcUk0EgXfuxWVn8gJlCbV27pn9dOlhCP wtliLRzU6i/hZNs8Ry0e5uEzwT2Z6T0o5r8drIYOD3l6T7ZrhVafRutirk6PV0rZCVcOFb BtYruYfxTL120pqbNQdjm9P1JXZOtno= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-421-vYqB6X6BPFGg4iR8LX8ICQ-1; Wed, 24 Aug 2022 10:12:09 -0400 X-MC-Unique: vYqB6X6BPFGg4iR8LX8ICQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB10A811E83; Wed, 24 Aug 2022 14:12:08 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9F072026D4C; Wed, 24 Aug 2022 14:12:07 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20220824093501.384755-1-dwysocha@redhat.com> <20220824093501.384755-3-dwysocha@redhat.com> <429ecc819fcffe63d60dbb2b72f9022d2a21ddd8.camel@hammerspace.com> To: Trond Myklebust Cc: dhowells@redhat.com, willy@infradead.org, "dwysocha@redhat.com" , "linux-cachefs@redhat.com" , "linux-nfs@vger.kernel.org" , "daire.byrne@gmail.com" , "anna.schumaker@netapp.com" , "benmaynard@google.com" Subject: Re: [RFC PATCH 2/3] NFS: Add support for netfs in struct nfs_inode and Kconfig MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <216679.1661350326.1@warthog.procyon.org.uk> Date: Wed, 24 Aug 2022 15:12:06 +0100 Message-ID: <216681.1661350326@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Trond Myklebust wrote: > As long as it is an opt-in feature, I'm OK. I don't want to have to > compile it in by default. > A cachefs should never become a mandatory feature of networked > filesystems. netfslib is intended to be used even if fsache is not enabled. It is intended to make the underlying network filesystem maintainer's life easier by: - Moving the implementation of all the VM ops from the network filesystems as much as possible into one place. The network filesystem then just has to provide a read op and a write op. - Making it such that the filesystem doesn't have to deal with the difference between DIO and buffered I/O - Handling VM features on behalf of all filesystems. This gives the VM folk one place to change instead of 5+. mpage and iomap are similar things but for blockdev filesystems. - Providing features to those filesystems that can support them, eg.: - fscrypt - compression - bounce buffering - local caching - disconnected operation Currently nfs interacts with fscache on a page-by-page basis, but this needs to change: (1) Multipage folios are now a thing. You need to roll folios out into nfs if you're going to take advantage of this. Also, you may have noticed that all the VM interfaces are being recast in terms of folios. (2) I need to fix the cache so that it no longer uses the backing filesystem's metadata to track content. To make this use less diskspace, I want to increase the cache block size to, say, 256K or 2M. This means that the cache needs to have a say in how big a read the network filesystem does - and also that a single cache request might need to be stitched together from multiple read ops. (3) More pagecache changes are lurking in the future, possibly including getting rid of the concept of pages entirely from the pagecache. There are users of nfs + fscache and we'd like to continue to support them as best as possible but the current code noticably degrades performance here. Unfortunately, I'm also going to need to drop the fallback interface which nfs currently uses in the next couple versions, we have to at least get the fscache enabled conversion done. I've been dealing with the VM, 9p, ceph and cifs people over the direction that netfslib might need to go in, but for nfs, it's typically been a flat "no". I would like to work out how to make netfslib work for nfs also, if you're willing to discuss it. I would be open to having a look at importing nfs page handling into netfslib and working from that - but it still needs to deal with (1) and (2) above, and I would like to make it pass iterators down to the lower layers as buffer descriptions. It's also very complicated stuff. Also: - I've noted the nfs_page structs that nfs uses and I'm looking at a way of having something similar, but held separately so that one struct can span and store information about multiple folios. - I'm looking at punting write-to-the-cache to writepages() or something like that so that the VM folks can reclaim the PG_private_2 flag bit, so that won't be available to nfs either in the future. - aops->write_begin() and ->write_end() are going to go away. In netfslib what I'm trying to do is make a "netfs_perform_write" as a parallel to generic_perform_write(). David