Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6442328rwp; Mon, 17 Jul 2023 23:45:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlHtYU95NAidWQCMfZjwnqMl0f0v/LZ6cIlEupHb53qy9XcwYFx7KL7U165WvGknRitlnHtX X-Received: by 2002:aa7:c698:0:b0:521:7779:d918 with SMTP id n24-20020aa7c698000000b005217779d918mr7941510edq.19.1689662740072; Mon, 17 Jul 2023 23:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689662740; cv=none; d=google.com; s=arc-20160816; b=ggs1bXp4G3aq65HeNAAFHdWbsORRzqo9b2Bq5vhBejTmhmpkCBtOxviYy+I/huS+iB g7qvgmex8kxh7c/FMk3ebnqT/U0QILSFh5RsRduAhPdj4eUK5Pcr1/kbF5eRiszTe3vJ f9KZPQUYiHfPjvebT+aIX17DfQkUSt6LsgMAPPT1g4j/f9DQRQ71sn9c1eiSGVCgzvg8 6VMFlsRawdpAduqWu346NDjBMJVHm+LxDKyjbPVl+cFIwU5c08aI6D8TqhyXCqDZd/lM eMb4KR0vZUGnsyH8emmXDBZYDG6eTWNAGzdzaFMtVwoyrMNOlbO02z8ySZ5VVHp0/WJR zh6A== 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:cc:to:from:subject:dkim-signature :dkim-signature; bh=8aKr8hgNV53KfPAWTBs1EGAfa9oI5wKwQm+OjfP5qdE=; fh=BG1K0WrNCDl2IiSLnDtgJLHPQBaNsmsTJjqgDAImPg0=; b=MUfBuTW5Ws0SifpPP2n0Hy+xTItdb4xC/1a5j3rz00AqT2vToy+j90itTa9ik+cNDF 45PcOXxGnCP3yWziORKUMYeiwSdpHR8kEzBBsCa5sPJ6XA5TtJS5PyJ+etrdFY8WqltP Lv25jjviqFWrep+W8MYsxMEO1sWGPz3ZGPCvoTqt6rED0DFfxanYo3OFfKQDw0Ug4+dX 1sfTaomF5fkHOlt9n2XMmmFDuGWokKWWNefQYXL+oXE6INcE+WsJz6YvVHrtLn9sJEUK S+kv3ZeOoK50RviQvQXElO4nueXmdc3Y9jWl46rekFdVbMP4vxcxnqDJf1aTK/zFDtKr 7IbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=m2ApP84J; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=lucg8kQl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020aa7cd05000000b0051e1b802ef9si783177edw.96.2023.07.17.23.45.09; Mon, 17 Jul 2023 23:45:40 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=m2ApP84J; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=lucg8kQl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbjGRGjI (ORCPT + 99 others); Tue, 18 Jul 2023 02:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbjGRGjH (ORCPT ); Tue, 18 Jul 2023 02:39:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA10813E for ; Mon, 17 Jul 2023 23:39:01 -0700 (PDT) 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 5BA862193C; Tue, 18 Jul 2023 06:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689662340; 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=8aKr8hgNV53KfPAWTBs1EGAfa9oI5wKwQm+OjfP5qdE=; b=m2ApP84JDWn9cnz1eg/XdtA8WPHmxouOTwJOOK/MhIRDxzV33ltTdx7WkxxutFfekFN3IH kZRTNxVQKDxMYKcb13GUA9kLBoYsNn2drMrKxn9pC7wKn38hjHJX2r2ltM1/TD6GAwTSmz ZXapi68dfiWoy9lUuUXcviXReewEIwQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689662340; 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=8aKr8hgNV53KfPAWTBs1EGAfa9oI5wKwQm+OjfP5qdE=; b=lucg8kQlA2utsWot94Zo6f40SX8MoumFwXKMevfKPWm+1SIiIcXMShGjtlCM4b0R/6XkOw h51y6Nj+NLtspIAg== 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 178F113494; Tue, 18 Jul 2023 06:38:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id swViLoIztmQRDAAAMHmgww (envelope-from ); Tue, 18 Jul 2023 06:38:58 +0000 Subject: [PATCH 00/14] Refactor SUNRPC svc thread code, and use llist From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org Date: Tue, 18 Jul 2023 16:38:08 +1000 Message-ID: <168966227838.11075.2974227708495338626.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 This code .... grew a bit since my previous pencil-sketch code. The goal is really the final patch: using a llist without spinlocks to handle dispatch of idle threads. To get there I found it necessary - or at least helpful - to do a lot of refactoring. This code passes some basic tests, but I haven't push it hard yet. Even if other aren't convinced that llists are the best solution, I think a lot of the refactoring is this valuable. Comments welcome, Thanks, NeilBrown --- NeilBr own (14): lockd: remove SIGKILL handling. nfsd: don't allow nfsd threads to be signalled. SUNRPC: call svc_process() from svc_recv(). SUNRPC: change svc_recv() to return void. SUNRPC: remove timeout arg from svc_recv() SUNRPC: change various server-side #defines to enum SUNRPC: refactor svc_recv() SUNRPC: integrate back-channel processing with svc_recv() and svc_process() SUNRPC: change how svc threads are asked to exit. SUNRPC: change svc_pool_wake_idle_thread() to return nothing. SUNRPC: add list of idle threads SUNRPC: discard SP_CONGESTED SUNRPC: change service idle list to be an llist SUNRPC: only have one thread waking up at a time fs/lockd/svc.c | 49 ++----- fs/lockd/svclock.c | 9 +- fs/nfs/callback.c | 59 +------- fs/nfsd/nfs4proc.c | 10 +- fs/nfsd/nfssvc.c | 22 +-- include/linux/llist.h | 2 + include/linux/lockd/lockd.h | 4 +- include/linux/sunrpc/cache.h | 11 +- include/linux/sunrpc/svc.h | 87 +++++++++--- include/linux/sunrpc/svc_xprt.h | 39 +++--- include/linux/sunrpc/svcauth.h | 29 ++-- include/linux/sunrpc/svcsock.h | 2 +- include/linux/sunrpc/xprtsock.h | 25 ++-- include/trace/events/sunrpc.h | 5 +- lib/llist.c | 27 ++++ net/sunrpc/backchannel_rqst.c | 8 +- net/sunrpc/svc.c | 71 ++++------ net/sunrpc/svc_xprt.c | 226 ++++++++++++++++-------------- net/sunrpc/xprtrdma/backchannel.c | 2 +- 19 files changed, 347 insertions(+), 340 deletions(-) -- Signature