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 8996BC433EF for ; Tue, 23 Nov 2021 01:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbhKWBeD (ORCPT ); Mon, 22 Nov 2021 20:34:03 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:57770 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbhKWBeD (ORCPT ); Mon, 22 Nov 2021 20:34:03 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 630FA218B2; Tue, 23 Nov 2021 01:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637631055; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSKNHNBuywMFjn0Loc58mFyuV0OYRXvVnXRusEgMqDg=; b=jUgxt2LMjmAwmCghcbE62LPolL/xJNhZkLBjA1s3wi8JSJe+POiASQrAs5mnXrvZX9aHut rxwgA2b5NBbtit/hkCW4Br6Af9F3xXKAY1feshA1nIKGIRsl3EJBkr+qFfp1XdQfSxQ8os l5JHY/6WAjJbtc8CK+Hc6bCeyVT7hX8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637631055; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSKNHNBuywMFjn0Loc58mFyuV0OYRXvVnXRusEgMqDg=; b=JjMx5zTv391rq4dV2zHZDZ+bpnZ3O8bs/wMIiV3i28hYb3UKeBvKFjVtdScOaFj3MOBmhD SRmGHVJbI9ERxnBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3E5E213BD4; Tue, 23 Nov 2021 01:30:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id knj5OU1EnGGdcwAAMHmgww (envelope-from ); Tue, 23 Nov 2021 01:30:53 +0000 Subject: [PATCH 00/19 v2] SUNRPC: clean up server thread management From: NeilBrown To: "J. Bruce Fields" , Chuck Lever Cc: linux-nfs@vger.kernel.org Date: Tue, 23 Nov 2021 12:29:35 +1100 Message-ID: <163763078330.7284.10141477742275086758.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This is a revision of my series for cleaning up server thread management. Currently lockd, nfsd, and nfs-callback all manage threads slightly differently. This series unifies them. Changes since first series include: - minor bug fixes - kernel-doc comments for new functions - split first patch into 3, and make the bugfix a separate patch - fix management of pool_maps so lockd can usse svc_set_num_threads safely - switch nfs-callback to not request a 'pooled' service. NeilBrown --- NeilBrown (19): SUNRPC/NFSD: clean up get/put functions. NFSD: handle error better in write_ports_addfd() SUNRPC: stop using ->sv_nrthreads as a refcount nfsd: make nfsd_stats.th_cnt atomic_t SUNRPC: use sv_lock to protect updates to sv_nrthreads. NFSD: narrow nfsd_mutex protection in nfsd thread NFSD: Make it possible to use svc_set_num_threads_sync SUNRPC: discard svo_setup and rename svc_set_num_threads_sync() NFSD: simplify locking for network notifier. lockd: introduce nlmsvc_serv lockd: simplify management of network status notifiers lockd: move lockd_start_svc() call into lockd_create_svc() lockd: move svc_exit_thread() into the thread lockd: introduce lockd_put() lockd: rename lockd_create_svc() to lockd_get() SUNRPC: move the pool_map definitions (back) into svc.c SUNRPC: always treat sv_nrpools==1 as "not pooled" lockd: use svc_set_num_threads() for thread start and stop NFS: switch the callback service back to non-pooled. fs/lockd/svc.c | 194 ++++++++++++------------------------- fs/nfs/callback.c | 12 +-- fs/nfsd/netns.h | 13 +-- fs/nfsd/nfsctl.c | 24 ++--- fs/nfsd/nfssvc.c | 139 +++++++++++++------------- fs/nfsd/stats.c | 2 +- fs/nfsd/stats.h | 4 +- include/linux/sunrpc/svc.h | 58 ++++------- net/sunrpc/svc.c | 166 ++++++++++++++----------------- 9 files changed, 248 insertions(+), 364 deletions(-) -- Signature