mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
SUNRPC: Per-rpc_clnt task PIDs
The current range of RPC task PIDs is 0..65535. That's not adequate for distinguishing tasks across multiple rpc_clnts running high throughput workloads. To help relieve this situation and to reduce the bottleneck of having a single atomic for assigning all RPC task PIDs, assign task PIDs per rpc_clnt. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
8e09650f5e
commit
0392dd51f9
2 changed files with 11 additions and 2 deletions
|
@ -40,6 +40,7 @@ struct rpc_clnt {
|
||||||
unsigned int cl_clid; /* client id */
|
unsigned int cl_clid; /* client id */
|
||||||
struct list_head cl_clients; /* Global list of clients */
|
struct list_head cl_clients; /* Global list of clients */
|
||||||
struct list_head cl_tasks; /* List of tasks */
|
struct list_head cl_tasks; /* List of tasks */
|
||||||
|
atomic_t cl_pid; /* task PID counter */
|
||||||
spinlock_t cl_lock; /* spinlock */
|
spinlock_t cl_lock; /* spinlock */
|
||||||
struct rpc_xprt __rcu * cl_xprt; /* transport */
|
struct rpc_xprt __rcu * cl_xprt; /* transport */
|
||||||
const struct rpc_procinfo *cl_procinfo; /* procedure info */
|
const struct rpc_procinfo *cl_procinfo; /* procedure info */
|
||||||
|
|
|
@ -277,9 +277,17 @@ static int rpc_wait_bit_killable(struct wait_bit_key *key, int mode)
|
||||||
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS)
|
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS)
|
||||||
static void rpc_task_set_debuginfo(struct rpc_task *task)
|
static void rpc_task_set_debuginfo(struct rpc_task *task)
|
||||||
{
|
{
|
||||||
static atomic_t rpc_pid;
|
struct rpc_clnt *clnt = task->tk_client;
|
||||||
|
|
||||||
task->tk_pid = atomic_inc_return(&rpc_pid);
|
/* Might be a task carrying a reverse-direction operation */
|
||||||
|
if (!clnt) {
|
||||||
|
static atomic_t rpc_pid;
|
||||||
|
|
||||||
|
task->tk_pid = atomic_inc_return(&rpc_pid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
task->tk_pid = atomic_inc_return(&clnt->cl_pid);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void rpc_task_set_debuginfo(struct rpc_task *task)
|
static inline void rpc_task_set_debuginfo(struct rpc_task *task)
|
||||||
|
|
Loading…
Add table
Reference in a new issue