From patchwork Wed Aug 30 13:05:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13370448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB244C83F24 for ; Wed, 30 Aug 2023 18:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232059AbjH3S3k (ORCPT ); Wed, 30 Aug 2023 14:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244373AbjH3NGC (ORCPT ); Wed, 30 Aug 2023 09:06:02 -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 EE39E185 for ; Wed, 30 Aug 2023 06:05:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83F5960EEA for ; Wed, 30 Aug 2023 13:05:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A616C433C7; Wed, 30 Aug 2023 13:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693400758; bh=SajL3ykSEyeKs7KkCsd2SeLPFcq6xM+CIa47dZ5dyWY=; h=From:To:Cc:Subject:Date:From; b=ZnesuVrPvSumu6/WzKQtZOB9o0FS094VBOfbLybklsjfk1oJ1hheIh31waQDHkrtC NuxjbEBvwx6B+nDQ2stLg8dNfRaQ05wFR9leNEEtjyvfyyjxbZtfLggq4YA4UFHsPg xXFswmpxjXmS31vNPR6nvSFv4tBJoUuRAtKJprQkkm4W3pa0potKniL2XVs8eStJei /9EqI9UOA6igJU9oXJn+tXCkSzbuVlWMnOoC0lCuYt+sKATWM7+2zmNGZ69KgMH+l2 K8bmFvkcMvJwVT+aIyi/oh4jXPAJm6VPCI1hdIQykeak4eRN7KJPUs8U6SHwiuiH5R 64zTr5rD+W3dA== From: Lorenzo Bianconi To: linux-nfs@vger.kernel.org Cc: lorenzo.bianconi@redhat.com, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de Subject: [PATCH v7 0/3] add rpc_status netlink support for NFSD Date: Wed, 30 Aug 2023 15:05:43 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Introduce rpc_status netlink support for NFSD in order to dump pending RPC requests debugging information from userspace. The new code can be tested with the user-space tool reported below: https://github.com/LorenzoBianconi/nfsd-rpc-netlink-monitor/tree/main Changes since v6: - report info to user-space through netlink and get rid of the related entry in the procfs Changes since v5: - add missing delimiters for nfs4 compound ops - add a header line for rpc_status handler - do not dump rq_prog - do not dump rq_flags in hex Changes since v4: - rely on acquire/release APIs and get rid of atomic operation - fix kdoc for nfsd_rpc_status_open - get rid of ',' as field delimiter in nfsd_rpc_status hanlder - move nfsd_rpc_status before nfsd_v4 enum entries - fix compilantion error if nfsdv4 is not enabled Changes since v3: - introduce rq_status_counter in order to detect if the RPC request is pending and RPC info are stable - rely on __svc_print_addr to dump IP info Changes since v2: - minor changes in nfsd_rpc_status_show output Changes since v1: - rework nfsd_rpc_status_show output Changes since RFCv1: - riduce time holding nfsd_mutex bumping svc_serv refcoung in nfsd_rpc_status_open() - dump rqstp->rq_stime - add missing kdoc for nfsd_rpc_status_open() Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=3D3D366 Lorenzo Bianconi (3): SUNRPC: export nfsd4_op_name utility routine SUNRPC: export svc_proc_name utility routine NFSD: add rpc_status netlink support fs/nfsd/nfs4proc.c | 4 +- fs/nfsd/nfsctl.c | 275 +++++++++++++++++++++++++++++++++++++ fs/nfsd/nfsd.h | 25 ++++ fs/nfsd/nfssvc.c | 15 ++ fs/nfsd/state.h | 2 - include/linux/sunrpc/svc.h | 1 + include/uapi/linux/nfs.h | 54 ++++++++ net/sunrpc/svc.c | 2 +- 8 files changed, 372 insertions(+), 6 deletions(-)