有些情况下还会有hung task的日志。
分析过程参考openeuler issue。
5483b904bf33 SUNRPC: Should wake up the privileged task firstly.
fcb170a9d825 SUNRPC: Fix the batch tasks count wraparound.
根据打印的日志,挂载不上是因为__rpc_execute()
中的捕获到信号:
__rpc_execute("RPC: %5u sync task going to sleep
dprintk
out_of_line_wait_on_bit
__wait_on_bit// (*action)(
rpc_wait_bit_killable if (signal_pending_state
return -ERESTARTSYS // 512
("RPC: %5u got signal
dprintk(task, -ERESTARTSYS rpc_exit
打印出很多rpc任务是因为写/proc/sys/sunrpc/rpc_debug
文件:
proc_dodebug
rpc_show_tasks(clnt, &sn->all_clients,
list_for_each_entry(task, &clnt->cl_tasks, // 存在任务才会打印
list_for_each_entry
rpc_show_header rpc_show_task
ForeChannel Slot table
相关的流程:
nfs4_alloc_session(..., "ForeChannel Slot table")
nfs4_init_slot_table(&tbl->slot_tbl_waitq, ...)
rpc_init_priority_wait_queue
__rpc_init_priority_wait_queue
rpc_assign_waitqueue_name->name = name;
q
nfs4_setup_sequenceif (nfs4_slot_tbl_draining(tbl) // 如果正在清空slot,则执行goto out_sleep
// 如果找不到空闲的slot,也执行goto out_sleep
nfs4_alloc_slot :
out_sleep(&tbl->slot_tbl_waitq,
rpc_sleep_on_priority(&tbl->slot_tbl_waitq, rpc_sleep_on
我们还可以在虚拟机中尝试把server端服务停掉,然后写文件,修改/proc/sys/sunrpc/rpc_debug
文件的值时,
打印的是类似91 4080 0 8eecf24b e2badc1c 3000 66c9f56f nfsv4 GETATTR a:call_timeout q:delayq
:
// 初始化delayq
init_sunrpc
rpc_init_mempool(&delay_queue, "delayq")
rpc_init_wait_queue
rpc_delay(&delay_queue,
rpc_sleep_on
__rpc_sleep_on_priority __rpc_add_wait_queue