From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7B712C2360; Mon, 29 Jun 2026 17:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782755305; cv=none; b=kzlrHFGkgZTtnq7VUvrxh/Debma/V7T+Arj8JDibHi0MtHMUpFbBBehprA/IdEKVZKcXm2rqnqb9DCObTXTVT4xm5S356k1+zXbctOAXAK2QXbDR3ozRUGcN/Jihx40mbIEDsydDWNYJPwWftaVD6IO9Cn5r7EHtcSWvki4vPAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782755305; c=relaxed/simple; bh=rVwwBj0IXKRGpyPzpLQLuQHJcowq+zOrIyiLcDEaG6E=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=f4ccVrCIXJ6crXWAifp3zti78Ue8N5VZsABiAcm5CZDFr6LDIKiUf1G7m22SKyS6MEuNWxLQKCPKx/y45H2/lY9MIWf5O2w6l1PdJC4EMBEyfLClFs/QIa3A7ppHLCD+4r8m+PccQSO+oI23H3gURcMMtZnjNMosGsUy4v3/ikM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YNNqG3WM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YNNqG3WM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D65F1F000E9; Mon, 29 Jun 2026 17:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782755304; bh=0Zp0WPQwfxwHO4YDczUn9V6N0XXYiebdEzrw2p7iYKA=; h=From:Subject:Date:To:Cc; b=YNNqG3WM6lDLFsfF+XqhGz31D5CfmD8Uthft6MYAdvC7Vrt5743twx8osnA7PiDdi /XpYVg79MRXXwQPfCg6gQsHMJCdRwKEg4exGvn6OIy7u0xhaXLOwHYej2WZ+mA2Yub 3/EKWIpQZBjZw0f+FbEjAP5X/WQUAfNnXdiP0M5pcy/RHSSep7L2OyZ0d+ImbU+to8 lm6vZ6hJ3N1EggxR+0f7nHjcOMp9VbMe+TW+Oq6h2Uk2d93P2SLbRFxMBAkU+GPMt4 5I0tjF9/I5NLQJlO/2P4nV5aWk/mkgEkix/iG9gb4aqkywm4zJuB6CYpiEPgUUZGy5 nboU/Z2KHKgGA== From: Jeff Layton Subject: [PATCH v3 0/4] sunrpc: hardcode pool_mode to pernode, remove other modes Date: Mon, 29 Jun 2026 13:48:04 -0400 Message-Id: <20260629-sunrpc-pool-mode-v3-0-d92676606dfd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33NTQ7CIBCG4as0rMXA8FN15T2MC2mnLbECASWap neXdmNMjMv3S+aZiSSMFhM5VBOJmG2y3pUQm4o0w8X1SG1bmgADzSQImh4uhoYG70d68y1Sgdo oLYC1jSTlLETs7HMlT+fSg013H1/rh8yX9Q+WOeXU1B0wFKqWe3O8YnQ4bn3syaJl+Aga1A8Bi iA7xcFo5Ii7L2Ge5zeEI8Gn8wAAAA== X-Change-ID: 20260423-sunrpc-pool-mode-3e6b56320dc4 To: Trond Myklebust , Anna Schumaker , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Chuck Lever Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2145; i=jlayton@kernel.org; h=from:subject:message-id; bh=rVwwBj0IXKRGpyPzpLQLuQHJcowq+zOrIyiLcDEaG6E=; b=owEBbQKS/ZANAwAKAQAOaEEZVoIVAcsmYgBqQq/hN7DgGqiQA18hCjxxhEtkSxZAipGSgUBN1 scK0nqhIfmJAjMEAAEKAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCakKv4QAKCRAADmhBGVaC FQZAD/9xMysJUREkw6raXU599PhGgakYF7mklPC9MukreN0EjVcJ37WtQioKQpWEqaL83uSbAJt i+Qg5Vj8K6ZAJDghat9BXOT3UK5AC3NDofaAudyAFVEYxtccdyPQ9qhsBRBw5r67ge5cdGziG4f b2YT5yJQOzbJpv/JuCx7Zzc4Af8pw40B0gSUY8+q/EIku8HJYmRvkYMmCiwQaTkNR3i1kP+srfE OrsvT46+52PAASCcaP7ZYj2NLCwsHLuhpPaYS1W469+RMxN3wgLZzMct777+pyWeDR6PR9ih+YR +mvTOziDoKQg8kLagBLJVNnpU+GwZoV++MSazUxXBu2TOqWtoUEEYhrCyDd1zBzaTHTArYX++K3 +IFfilX6GaRN38eS1gXsQk7FreNy0dZ9i+B0Ilyjr4vzJWkS/YOOWci1tvVz6hu/i9fzzMHB8Tz EgrsqKlcnwIg7yKWH/YpM1YXy/CETgas6roJaotqxTlxl0iU5v3b3+i64yLz1bgf+gWROBHGq/U l8olFlazgLinw4bwY4G6yiXKxYyQ9TwrkcE1ho6cfNs0eCSNHQuIaxylsLkqvHPHat29E/8aHJx X2Dt0kZgI7EzLzKX93/gvVUgvpxnpyei7gZDJKmfpg5m8WrsPakQTscOPVrlvFASaIsxU4NOr/F 5r/6LFNtV5NCUVA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 The second patch is basically the same as v2, aside from some changes that Neil suggested. The other three patches address what is a shortcoming of the existing code -- namely that the server can be configured to schedule RPCs to pools with no threads in them. The first patch addresses this problem: if the chosen pool has no threads, then choose another that does. The third patch tries to prevent this situation in the thread auto-placement case by ensuring that each node has at least one thread. The last patch is a performance micro-optimization. The old code used a modulus (actually two) to determine the pool (and prevent potentially overrunning the array). This trades that for a less cpu-intensive method of finding the pool to use. Signed-off-by: Jeff Layton --- Changes in v3: - Add patch to ensure that we don't route requests to empty pools - When auto-distributing threads, always create at least one thread per populated pool - Use sysfs_match_string for the module parameter - Reword deprecation printk to be more vague about removal - Explicitly set m_count == 0 in svc_pool_map_get() - Optimize svc_pool_for_cpu() by eliminating modulus ops - Link to v2: https://lore.kernel.org/r/20260625-sunrpc-pool-mode-v2-1-4f512b6e1ee8@kernel.org Changes in v2: - Accept any previously-accepted setting for pool_mode - Link to v1: https://lore.kernel.org/r/20260423-sunrpc-pool-mode-v1-1-b7f20e35749b@kernel.org --- Jeff Layton (4): sunrpc: route to a populated pool in svc_pool_for_cpu() sunrpc: hardcode pool_mode to pernode, remove other modes sunrpc: guarantee a thread per CPU-bearing node when auto-distributing sunrpc: eliminate a modulus operation from the enqueueing codepath Documentation/admin-guide/kernel-parameters.txt | 20 +- net/sunrpc/svc.c | 281 +++++++----------------- 2 files changed, 88 insertions(+), 213 deletions(-) --- base-commit: f8eb95335cc219493427f976460cf4b7e9641e92 change-id: 20260423-sunrpc-pool-mode-3e6b56320dc4 Best regards, -- Jeff Layton