Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1991724rwe; Fri, 2 Sep 2022 07:05:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ylnO76kLCEuq56SoyPNZc2kUm9k4R8f+3jbmOmOf6Ys2qbVmy8IAYQslv4dim4s3Pa262 X-Received: by 2002:a05:600c:1e10:b0:3a5:4f31:3064 with SMTP id ay16-20020a05600c1e1000b003a54f313064mr2899302wmb.136.1662127519905; Fri, 02 Sep 2022 07:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662127519; cv=none; d=google.com; s=arc-20160816; b=M8iuEOjTK53e7HUEfVy3Ffw84sPs/hYidXtC8lS0vfA6JhGjnVp578HmrLfl4lXRVL rTROaBmq2mzZ0zHnUd+8sljkzlC3XvExYii+3cj6Ub8MfZ4jBVK9pvxPJGwTeP7PV8Tg TIk7QdEpL5h6N8vMY8w8O7oV6gMZfhoOjHCg3QLnMP3mJzxp/jqEYAVMu3DaogeNtDXF BZKtmAfSvJqiusy9fVhzHnsWTd8I1NhJ6MajArJTH2g3IyPxyBVlJF83kltp90Us1ZvV EKsi0T5QcILDfZZW44+3ioHZowUoxOOvT2hqg05blVO5GybylEkDqZ4BGL/4dgVKeAaq Ei8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=//oTww4IL10gAZlRaKa6BxR+9lgtxLhYYaSzRmGcp9k=; b=pU+X3v+yiCwPc8HPTu6teZVVnkwLA8DsRwYC4mCFSTdiyz3bul7TFJ1rlAmcId5XlN PZ87QOUtxI9cEg6a+CRHqAePvRANdtkTdr4qHAoGsZQy2K8cDup1xXKAaLW4rf6Udwl+ j/2arhIsCUTckUvXyjpZnXuv6xpvM44TxkXsMrPDKdyEAzq+d/CT5A7QwMVdlAJPXBZu L14/2Xb627hNlXpHZwUTfdwwLXu0OpneL7cJfRXO2lh3ypuM3GHVFtctJBdwNG/11t4/ DTTIIlszqEz8EZRxMxOY7u/6BOOkDH5XY1YxP8o+nw04P9YHt2RJ3V0GBXI6wo0VKwho qTdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Odf7ELZN; 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 z23-20020a170906435700b0073305fd2278si1739813ejm.864.2022.09.02.07.04.54; Fri, 02 Sep 2022 07:05:19 -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=Odf7ELZN; 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 S238089AbiIBOER (ORCPT + 99 others); Fri, 2 Sep 2022 10:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239034AbiIBODx (ORCPT ); Fri, 2 Sep 2022 10:03:53 -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 1E8A81306CE for ; Fri, 2 Sep 2022 06:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662125547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=//oTww4IL10gAZlRaKa6BxR+9lgtxLhYYaSzRmGcp9k=; b=Odf7ELZNcMcfZOeb76rsRU3JmZs/KrT5GxvdPXyy+BBRujOvEIELAYHFbA2KjZxPHc6LBb ERnojjZBjK2epRwAuEtfhmxCbLBKFUQVH9zYnUqKsKzOtBt1S3bhAvJrt9TU/vONJSw2XZ TabMyfzob/9P4a5ylusPvzu/bJVfpW8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-461-6RagR_8hPkGMAlUs1vMoIA-1; Fri, 02 Sep 2022 08:53:48 -0400 X-MC-Unique: 6RagR_8hPkGMAlUs1vMoIA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E0DB2919EB8; Fri, 2 Sep 2022 12:53:48 +0000 (UTC) Received: from dwysocha.rdu.csb (unknown [10.22.8.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA45F492C3B; Fri, 2 Sep 2022 12:53:47 +0000 (UTC) From: Dave Wysochanski To: Anna Schumaker , Trond Myklebust , David Howells Cc: linux-nfs@vger.kernel.org, linux-cachefs@redhat.com, Benjamin Maynard , Daire Byrne Subject: [PATCH v5 0/3] Convert NFS with fscache to the netfs API Date: Fri, 2 Sep 2022 08:53:43 -0400 Message-Id: <20220902125346.1619659-1-dwysocha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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 This patchset converts NFS with fscache non-direct READ IO paths to use the netfs API with a non-invasive approach. The existing NFS pgio layer does not need extensive changes, and is the best way so far I've found to address Trond's concerns about modifying the IO path [1] as well as only enabling netfs when fscache is configured and enabled [2]. I have not attempted performance comparisions to address Chuck Lever's concern [3] because we are not converting the non-fscache enabled NFS IO paths to netfs. The main patch to be reviewed is patch #3 which converts nfs_read_folio and nfs_readahead. Changes since v4 (all PATCH3) - Remove more #ifdefs, replace with stub functions (Jeff Layton)[6] - Use refcount for last RPC marker (Jeff Layton)[6] The patches are fairly stable as evidenced with xfstests generic with various servers, both with and without fscache enabled: hammerspace(pNFS flexfiles): vers=4.2,fsc; vers=4.2 NetApp(pNFS filelayout): vers=4.1,fsc; vers=4.0,fsc RHEL8: vers=3,fsc; vers=3 No major issues outstanding. Even the previous issue with the "Subreq overread" was not reproducible with this set. The known issues are as follows: 1. Unit test setting rsize < readahead does not properly read from fscache but re-reads data from the NFS server * This will be fixed with another linux-cachefs [4] patch to resolve "Stop read optimisation when folio removed from pagecache" * Daire Byrne also verified the patch fixes his issue as well 2. "Cache volume key already in use" after xfstest runs * xfstests (hammerspace with vers=4.2,fsc) shows the following on the console after some tests: "NFS: Cache volume key already in use (nfs,4.1,2,c50,cfe0100a,3,,,8000,100000,100000,bb8,ea60,7530,ea60,1)" * This may be fixed with another patch [4] that is in progress The patchset is based on 6.0-rc3 and has been pushed to github at: https://github.com/DaveWysochanskiRH/kernel/commits/nfs-fscache-netfs [1] https://lore.kernel.org/linux-nfs/9cfd5bc3cfc6abc2d3316b0387222e708d67f595.camel@hammerspace.com/ [2] https://lore.kernel.org/linux-nfs/da9200f1bded9b8b078a7aef227fd6b92eb028fb.camel@hammerspace.com/ [3] https://marc.info/?l=linux-nfs&m=160597917525083&w=4 [4] https://www.mail-archive.com/linux-cachefs@redhat.com/msg03043.html [5] https://marc.info/?l=linux-nfs&m=165962662200679&w=4 [6] https://marc.info/?l=linux-nfs&m=166204800323762&w=4 Dave Wysochanski (3): NFS: Rename readpage_async_filler to nfs_pageio_add_page NFS: Configure support for netfs when NFS fscache is configured NFS: Convert buffered read paths to use netfs when fscache is enabled fs/nfs/Kconfig | 1 + fs/nfs/delegation.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/fscache.c | 256 ++++++++++++++++++++++++--------------- fs/nfs/fscache.h | 102 ++++++++++------ fs/nfs/inode.c | 8 +- fs/nfs/internal.h | 11 +- fs/nfs/pagelist.c | 12 ++ fs/nfs/pnfs.c | 12 +- fs/nfs/read.c | 110 ++++++++--------- fs/nfs/write.c | 2 +- include/linux/nfs_fs.h | 34 ++++-- include/linux/nfs_page.h | 3 + include/linux/nfs_xdr.h | 3 + 14 files changed, 341 insertions(+), 217 deletions(-) -- 2.31.1