Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3836340rdg; Wed, 18 Oct 2023 07:27:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRJeBC83LU/ctTe4d5VGx6CvU4eZsiMwsXRZF9e0hRKJHzH7sX0wL8Xm7tai3FijwNZuds X-Received: by 2002:a05:6a00:230b:b0:6be:30f1:45f8 with SMTP id h11-20020a056a00230b00b006be30f145f8mr6136177pfh.20.1697639246592; Wed, 18 Oct 2023 07:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697639246; cv=none; d=google.com; s=arc-20160816; b=ZoUSVpUcf0RFPUUAbtp+ByDS5UwanNXgEz2WpEoj/OOYPC1p9FF/VQT1RwnMrpxUR0 cqSWWCIExNaio5ij0go0bnEVHQv4sV6Sl69IaDjq9/7vZv65FEGMM96vkJdOsZT13e15 sczJbgROMxfhAHNxv1XehRLwGeqIcd46BRi+oFhM7lRJmWYbTfkHZDXH/KSCfyV4ZUix dVdGqXINL+QBWbPmdG7jDl+IKrAhpgrIe3drT31xSsOJX2FJfgqCSnzb3KeiORqLIdN5 Lrm4Ma5iaVWKQS4F6gRKTBfLF+4hIxDZnZHpFwVpCwnG1q68CeJpgDFTNEOACI/7wxG9 e0xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jn3IE8fVQ+MkCWQtv3yw/Yzn5j90c65owH4AJV1W7WU=; fh=UVWQCwMdXYixFKy4dDKt8AQteAswBJWIZwkQSyl/JI4=; b=vPtLoBS4KCRxmcz77NOVAXFQzOkOZTEpMROiqjkd95sDHMXfM0QqdjXxPYyxBpgZ/Z Vphxcxzv0mhTtUDYixgaPfQMLk3xxAl2EU+AJpMMEtxwHQ2RPCzt030//d+ht1dDXV4C OKlsNqbdvoWLDDcdmnQGX+Ey/TQlygJqinuBatuqwiYsTb391z20bOmjeo4jNmj26KxH d4lAYO7SNQgKPiND4uj5ggrYi8HrIFeiuIOHMPNLbOHc/+7lmTGMxXfHRdO5Mp0U5lRM 3Qmk7uKexCmccSLH61Bc3FXUlb0OrJEUbf7HWHn99jlqkkn7Dh+oWNW0yrWmc0iOWvCp 9xWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=htyU0Dpl; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id e3-20020aa79803000000b006bc3f09ea09si4006164pfl.26.2023.10.18.07.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=htyU0Dpl; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A6C83802393B; Wed, 18 Oct 2023 07:27:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345526AbjJRO1U (ORCPT + 99 others); Wed, 18 Oct 2023 10:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345438AbjJRO1J (ORCPT ); Wed, 18 Oct 2023 10:27:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBE6030CA for ; Wed, 18 Oct 2023 07:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697639077; 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=jn3IE8fVQ+MkCWQtv3yw/Yzn5j90c65owH4AJV1W7WU=; b=htyU0DplQwFGQr6h9srLokXR3gnFSXBg4WbfseevrPNRWVBNItjJYU2MTHof3kPrHy6R99 Euy54ZUQfRnXqddLCAyQ08szmXhYxD3WxOrv41Usjs/t154EZd0vjqdi8Dqx6j0ZSmH4j+ 0w9N8qedu4tzRFb6KAPomjgNixVJZ1M= 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-398-F3lyvaXkNIq4hnHOJzfw0g-1; Wed, 18 Oct 2023 10:24:34 -0400 X-MC-Unique: F3lyvaXkNIq4hnHOJzfw0g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BB1A88B77F; Wed, 18 Oct 2023 14:24:21 +0000 (UTC) Received: from [192.168.37.1] (unknown [10.22.48.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0433F1121318; Wed, 18 Oct 2023 14:24:19 +0000 (UTC) From: Benjamin Coddington To: Jeff Layton , Chuck Lever Cc: trond.myklebust@hammerspace.com, anna@kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 2/2] NFSv4: Allow per-mount tuning of READDIR attrs Date: Wed, 18 Oct 2023 10:24:18 -0400 Message-ID: <27DF51B5-0794-497B-A3F5-99F16B14D787@redhat.com> In-Reply-To: <6157b73e380e5b625cd8ed0133ef392d0dd4bd8b.camel@kernel.org> References: <6157b73e380e5b625cd8ed0133ef392d0dd4bd8b.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:27:21 -0700 (PDT) On 18 Oct 2023, at 9:33, Jeff Layton wrote: > On Wed, 2023-10-18 at 08:56 -0400, Chuck Lever wrote: >> On Tue, Oct 17, 2023 at 05:30:44PM -0400, Benjamin Coddington wrote: >>> Expose a per-mount knob in sysfs to set the READDIR requested attributes >>> for a non-plus READDIR request. >>> >>> For example: >>> >>> echo 0x800 0x800000 0x0 > /sys/fs/nfs/0\:57/v4_readdir_attrs >>> >>> .. will revert the client to only request rdattr_error and >>> mounted_on_fileid for any non "plus" READDIR, as before the patch >>> preceeding this one in this series. This provides existing installations >>> an option to fix a potential performance regression that may occur after >>> NFS clients update to request additional default READDIR attributes. >>> >>> Signed-off-by: Benjamin Coddington >>> --- >>> fs/nfs/client.c | 2 + >>> fs/nfs/nfs4client.c | 4 ++ >>> fs/nfs/nfs4proc.c | 1 + >>> fs/nfs/nfs4xdr.c | 7 ++-- >>> fs/nfs/sysfs.c | 81 +++++++++++++++++++++++++++++++++++++++ >>> include/linux/nfs_fs_sb.h | 1 + >>> include/linux/nfs_xdr.h | 1 + >>> 7 files changed, 93 insertions(+), 4 deletions(-) >> >> Admittedly, it would be much easier for humans to use if the API was >> based on the symbolic names of the bits rather than a triplet of raw >> hexadecimal values. This isn't aiming to be an ease-of-use interface. This is tinkering with the innards of the client. If you're doing this, you better know how to convert between bases, because you're going to need that and more. If we want to make it nice, patches to nfsctl can follow. > I think there are some significant footguns with this interface. It'd be > very easy to set this wrong and get weird behavior. OTOH, we could push > that complexity into userland and provide some sort of script in nfs- > utils for tuning this. > > That said... > > When we look at interfaces like this, we have to consider that they may > be around for a long, long time (decades, even), and people will come to > rely on them to do strange things that are difficult for us to support. > If we have someone saying that their READDIR performance slowed down, we > now have to grab those settings from this sysfs file and validate them > when trying to help them. > > Personally, I'd prefer a simple binary "make it work the old way" > switch, if we're concerned about performance regressions here. I think > that's the sort of thing that is simple to explain to admins that are > suffering from this problem and (more importantly) the sort of setting > we can later remove when it's no longer needed. > > Adding this sort of fine-grained knob will create more problems than it > solves, as people will (inevitably) use it incorrectly. I disagree that it will create more problems than it solves. Also, sysfs isn't there for you to experiment with in production, and sysadmins know this. Sysfs is "_The_ filesystem for exporting kernel objects". There are plenty of ways to hose a system and corrupt data by playing around with sysfs. If we take the position that everything in NFS' sysfs must have a higher standard of safety than even module parameters (see recover_lost_locks), that means we better look at making every sysfs interface non-shoot-footy, which is just insane. Just take a look at a sampling of writeable files, here's a couple: /sys/block/sda/device/delete /sys/kernel/sunrpc/xprt-switches/switch-1/xprt-0-local/dstaddr Ben