Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp959548imi; Fri, 22 Jul 2022 13:36:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sdameVUd03VjuVskx9FOPhuO3UiCIHylKquM/NcjHE1K2r+ZfUhdFpsZdhV22HKLtDqrXA X-Received: by 2002:a63:5cf:0:b0:419:ecc3:6fbc with SMTP id 198-20020a6305cf000000b00419ecc36fbcmr1333461pgf.192.1658522179047; Fri, 22 Jul 2022 13:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658522179; cv=none; d=google.com; s=arc-20160816; b=G/jy1yMLgmjyVq3jIM+WKwEtkgI8YFSssLZmOAGw3CsIA9AtOiFweY2viI0wTQF29P +o91vZ7epaH7qPPyZpANDEAC0Mz3LskM0slhPMeKwpapPKl2SQxwv4u5OeywjgIRJin9 6kdWYJWPzCjbHqVxbZPnhm7r0Shgijag0eEA4evKnEtSCZysdHIeGId6U/sPWpAewnRf /5wVHnDM4u3JVE7kUpfE4dpe5Fs9JyOQ57hoT1sJulLcolZqd/6SeGw/rOrJhpGBQ3Pj 6vI4zviSZGsKxE8ssIeVQkCcD+q0p31hxq8EdFnfqCig5Z4TZ4o281d95d0M6Wrg+uxr ldzA== 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 :user-agent:message-id:date:to:from:subject; bh=IgP3AtHl9keg07hFxnEaUPzuyc97Bssrb8i1ho2r+OU=; b=uxUgD+6Sl0HJyr1CW9yw13Jr7LqSp2nlWp4IwaLq7GNsNtGEKw5anFlWgnDNyPo6/m bYgBsdT+yOKKUsNydc6zUcBk/mH6aug7M7KXrkoIQ6x5btcnswSPdt2tE8nSR0TsnH0f D3ni5nHNtjmVVJ4gaFNndO9PGA+8A6XY7BtW3uDVhUKDAGy7D5ztiOa8qaMoiztZ/ic0 4VvJ+scKoVJy5AXGovlmcaNNlSlEsraNvOKYOKlxgpL/dhmTsXdd7cmpY2s4RHov+vtZ H5mVDRS0Y7wIvz6klocC9jBE6wiCNcJl+CwGYsAjyMnZqXy3zz2os1TDGKIwSB8FJ7LX S5Fw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k186-20020a6384c3000000b0040ce4de349csi6090071pgd.291.2022.07.22.13.36.04; Fri, 22 Jul 2022 13:36: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236362AbiGVUS7 (ORCPT + 99 others); Fri, 22 Jul 2022 16:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235796AbiGVUS7 (ORCPT ); Fri, 22 Jul 2022 16:18:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 955EE7F50A for ; Fri, 22 Jul 2022 13:18:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3481D61FFB for ; Fri, 22 Jul 2022 20:18:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87FA2C341C6 for ; Fri, 22 Jul 2022 20:18:57 +0000 (UTC) Subject: [PATCH v1 00/11] Put struct nfsd4_copy on a diet From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 22 Jul 2022 16:18:56 -0400 Message-ID: <165852076926.11403.44005570813790008.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 While testing NFSD for-next, I noticed svc_generic_init_request() was an unexpected hot spot on NFSv4 workloads. Drilling into the perf report, it shows that the hot path in there is: 1208 memset(rqstp->rq_argp, 0, procp->pc_argsize); 1209 memset(rqstp->rq_resp, 0, procp->pc_ressize); For an NFSv4 COMPOUND, procp->pc_argsize = sizeof(nfsd4_compoundargs), struct nfsd4_compoundargs on my system is more than 17KB! This is due to the size of the iops field: struct nfsd4_op iops[8]; Each struct nfsd4_op contains a union of the arguments for each NFSv4 operation. Each argument is typically less than 128 bytes except that struct nfsd4_copy and struct nfsd4_copy_notify are both larger than 2KB each. I'm not yet totally convinced this series never orphans memory, but it does reduce the size of nfsd4_compoundargs to just over 4KB. This is still due to struct nfsd4_copy being almost 500 bytes. I don't see more low-hanging fruit there, though. --- Chuck Lever (11): NFSD: Shrink size of struct nfsd4_copy_notify NFSD: Shrink size of struct nfsd4_copy NFSD: Reorder the fields in struct nfsd4_op NFSD: Make nfs4_put_copy() static NFSD: Make boolean fields in struct nfsd4_copy into atomic bit flags NFSD: Refactor nfsd4_cleanup_inter_ssc() (1/2) NFSD: Refactor nfsd4_cleanup_inter_ssc() (2/2) NFSD: Refactor nfsd4_do_copy() NFSD: Remove kmalloc from nfsd4_do_async_copy() NFSD: Add nfsd4_send_cb_offload() NFSD: Move copy offload callback arguments into a separate structure fs/nfsd/nfs4callback.c | 37 +++++---- fs/nfsd/nfs4proc.c | 165 +++++++++++++++++++++-------------------- fs/nfsd/nfs4xdr.c | 30 +++++--- fs/nfsd/state.h | 1 - fs/nfsd/xdr4.h | 54 ++++++++++---- 5 files changed, 163 insertions(+), 124 deletions(-) -- Chuck Lever