Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp508258imn; Wed, 27 Jul 2022 12:08:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1snrC0Vw3C2fyWfusOkm0Qg4MWIZMWxvZeIkR5cjqtaU+54f+/F3jpQTgwcLR9qkfo2GgJQ X-Received: by 2002:a17:907:2c4a:b0:72b:5b9b:9c50 with SMTP id hf10-20020a1709072c4a00b0072b5b9b9c50mr18717048ejc.636.1658948907531; Wed, 27 Jul 2022 12:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948907; cv=none; d=google.com; s=arc-20160816; b=t/9cNd0nCljFh952FdqzwPeILrwF4G/pRjXL8Z9Swl9wQdvVqdI90NXf7zBWzez0cK oAosbXQQPRfc1hYWknM+avpL7zsZYGn0u3BC/ATg1SaDB9sQnCWMJKT2q1xiTbLrJmOP 8IEfdfvzPjbUCPE5szJ6D7qdCi1sBBHDE82pasqg3rcSy8Uy8H6lcxqJfM0JNlcB+jA9 Ccf6teSx740gjq41hu6n/ro7UHr+BBTZpmh4cRmZD8Ui6zAtYW9ZmQOv5x6E9ZvOaWkG iUDW4EXxu/w9xnN+smRd8WteI1J2xFGFb8GVRAn2cgkPSiS20Mbg4/2kJFm8mrATfv33 658g== 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=xkGBj6mDlk+dm9DBL2kD37fZJL6RN+KMSfiBC/3wqOE=; b=tg/TlS13Mx5yaoj8ZzzIsnwT0EGhI7Ls6AycO0zW02koo4BVPp79rKGrZR7EPoLQlV qFJDp2BXGlSPovD30eiAgbcVPXwHFhJPEJwjcfGsC3oGdlJD+SI3BfohRpRhRWB99gSm EpJllnZM+g1Xo7ta4CQQslohxzOZnn8fHRNvEbRUwoqQvDJ4QbLeLaCk1QPjRlykx06N 6LNzE33D0/s67+LW7LaeWFJhxJ1/FRC/7fLlsJ+Hso1vUeh9UlGFGOrXB+bA7pT3E2ca 05zXKh3iRq14FJketwOichQEMYYzAzlbqVr8aDpUY6krEzYR+lwSFYEFExJVCzqFRjq+ pz6A== 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 i21-20020a05640242d500b0043a4cff7e3csi14561965edc.423.2022.07.27.12.07.58; Wed, 27 Jul 2022 12:08:27 -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 S235512AbiG0THZ (ORCPT + 99 others); Wed, 27 Jul 2022 15:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235185AbiG0TGy (ORCPT ); Wed, 27 Jul 2022 15:06:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 449FE52FF1 for ; Wed, 27 Jul 2022 11:39:59 -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 D5F1F6197E for ; Wed, 27 Jul 2022 18:39:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33222C433D6 for ; Wed, 27 Jul 2022 18:39:58 +0000 (UTC) Subject: [PATCH v2 00/13] Put struct nfsd4_copy on a diet From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Wed, 27 Jul 2022 14:39:57 -0400 Message-ID: <165894669884.11193.6386905165076468843.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. Changes since v1: - Fix a compile-time bug spotted by the kernel 0-day robot - Fix a crasher reported by Dai, then by Olga - Add two more clean-up patches --- Chuck Lever (13): NFSD: Fix strncpy() fortify warning NFSD: nfserrno(-ENOMEM) is nfserr_jukebox 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 | 169 ++++++++++++++++++++-------------------- fs/nfsd/nfs4xdr.c | 33 +++++--- fs/nfsd/state.h | 1 - fs/nfsd/xdr4.h | 54 +++++++++---- include/linux/nfs_ssc.h | 2 +- 6 files changed, 167 insertions(+), 129 deletions(-) -- Chuck Lever