]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Don't disable preemption while calling svc_pool_for_cpu().
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 10 May 2022 14:38:33 +0000 (16:38 +0200)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 19 May 2022 16:25:40 +0000 (12:25 -0400)
commitb58a87d378856a2fbdc6ab6c496dd82ac7ce2d0e
tree75c581d0e3e6e0141eddebd654f1ca3501c62195
parent3b1edb7ad05a622b4c04231a7ea164dadd8d38e5
SUNRPC: Don't disable preemption while calling svc_pool_for_cpu().

svc_xprt_enqueue() disables preemption via get_cpu() and then asks
for a pool of a specific CPU (current) via svc_pool_for_cpu().
While preemption is disabled, svc_xprt_enqueue() acquires
svc_pool::sp_lock with bottom-halfs disabled, which can sleep on
PREEMPT_RT.

Disabling preemption is not required here. The pool is protected with a
lock so the following list access is safe even cross-CPU. The following
iteration through svc_pool::sp_all_threads is under RCU-readlock and
remaining operations within the loop are atomic and do not rely on
disabled-preemption.

Use raw_smp_processor_id() as the argument for the requested CPU in
svc_pool_for_cpu().

Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/svc_xprt.c