]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.8/sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch
Linux 6.6.27
[thirdparty/kernel/stable-queue.git] / queue-6.8 / sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch
1 From 4b4cfeefb2227540e2d5f5bce7aa2a4d89701e84 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 30 Jan 2024 11:38:25 -0800
4 Subject: SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to
5 unsigned int
6
7 From: Dai Ngo <dai.ngo@oracle.com>
8
9 [ Upstream commit 2c35f43b5a4b9cdfaa6fdd946f5a212615dac8eb ]
10
11 When the NFS client is under extreme load the rpc_wait_queue.qlen counter
12 can be overflowed. Here is an instant of the backlog queue overflow in a
13 real world environment shown by drgn helper:
14
15 rpc_task_stats(rpc_clnt):
16 -------------------------
17 rpc_clnt: 0xffff92b65d2bae00
18 rpc_xprt: 0xffff9275db64f000
19 Queue: sending[64887] pending[524] backlog[30441] binding[0]
20 XMIT task: 0xffff925c6b1d8e98
21 WRITE: 750654
22 __dta_call_status_580: 65463
23 __dta_call_transmit_status_579: 1
24 call_reserveresult: 685189
25 nfs_client_init_is_complete: 1
26 COMMIT: 584
27 call_reserveresult: 573
28 __dta_call_status_580: 11
29 ACCESS: 1
30 __dta_call_status_580: 1
31 GETATTR: 10
32 __dta_call_status_580: 4
33 call_reserveresult: 6
34 751249 tasks for server 111.222.333.444
35 Total tasks: 751249
36
37 count_rpc_wait_queues(xprt):
38 ----------------------------
39 **** rpc_xprt: 0xffff9275db64f000 num_reqs: 65511
40 wait_queue: xprt_binding[0] cnt: 0
41 wait_queue: xprt_binding[1] cnt: 0
42 wait_queue: xprt_binding[2] cnt: 0
43 wait_queue: xprt_binding[3] cnt: 0
44 rpc_wait_queue[xprt_binding].qlen: 0 maxpriority: 0
45 wait_queue: xprt_sending[0] cnt: 0
46 wait_queue: xprt_sending[1] cnt: 64887
47 wait_queue: xprt_sending[2] cnt: 0
48 wait_queue: xprt_sending[3] cnt: 0
49 rpc_wait_queue[xprt_sending].qlen: 64887 maxpriority: 3
50 wait_queue: xprt_pending[0] cnt: 524
51 wait_queue: xprt_pending[1] cnt: 0
52 wait_queue: xprt_pending[2] cnt: 0
53 wait_queue: xprt_pending[3] cnt: 0
54 rpc_wait_queue[xprt_pending].qlen: 524 maxpriority: 0
55 wait_queue: xprt_backlog[0] cnt: 0
56 wait_queue: xprt_backlog[1] cnt: 685801
57 wait_queue: xprt_backlog[2] cnt: 0
58 wait_queue: xprt_backlog[3] cnt: 0
59 rpc_wait_queue[xprt_backlog].qlen: 30441 maxpriority: 3 [task cnt mismatch]
60
61 There is no effect on operations when this overflow occurs. However
62 it causes confusion when trying to diagnose the performance problem.
63
64 Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
65 Reviewed-by: Jeff Layton <jlayton@kernel.org>
66 Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
67 Signed-off-by: Sasha Levin <sashal@kernel.org>
68 ---
69 include/linux/sunrpc/sched.h | 2 +-
70 1 file changed, 1 insertion(+), 1 deletion(-)
71
72 diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
73 index 2d61987b35456..0c77ba488bbae 100644
74 --- a/include/linux/sunrpc/sched.h
75 +++ b/include/linux/sunrpc/sched.h
76 @@ -197,7 +197,7 @@ struct rpc_wait_queue {
77 unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */
78 unsigned char priority; /* current priority */
79 unsigned char nr; /* # tasks remaining for cookie */
80 - unsigned short qlen; /* total # tasks waiting in queue */
81 + unsigned int qlen; /* total # tasks waiting in queue */
82 struct rpc_timer timer_list;
83 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS)
84 const char * name;
85 --
86 2.43.0
87