函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\workqueue.c Create Date:2022-07-27 10:28:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:show_workqueue_state - dump workqueue state* Called from a sysrq handler or try_to_freeze_tasks() and prints out* all busy workqueues and pools.

函数原型:void show_workqueue_state(void)

返回类型:void

参数:

4747  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
4749  打印信息("Showing busy workqueues and worker pools:\n")
4753  bool idle = true
4755  r_each_pwq - iterate through all pool_workqueues of the specified workqueue*@pwq: iteration cursor*@wq: the target workqueue* This must be called either with wq->mutex held or RCU read locked(pwq, wq)
4756  如果L: nr of active works 或非链表为空
4757  idle = false
4758  退出
4761  如果idle则继续下一循环
4764  打印信息("workqueue %s: flags=0x%x\n", I: workqueue name , hot fields used during command issue, aligned to cacheline )
4766  r_each_pwq - iterate through all pool_workqueues of the specified workqueue*@pwq: iteration cursor*@wq: the target workqueue* This must be called either with wq->mutex held or RCU read locked(pwq, wq)
4767  spin_lock_irqsave( & he pool lock , flags)
4768  如果L: nr of active works 或非链表为空show_pwq(pwq)
4770  spin_unlock_irqrestore( & he pool lock , flags)
4776  h_nmi_watchdog - restart NMI watchdog timeout.* If the architecture supports the NMI watchdog, touch_nmi_watchdog()* may be used to reset the timeout - for code which intentionally* disables interrupts for a long time. This call is stateless.
4780  r_each_pool - iterate through all worker_pools in the system*@pool: iteration cursor*@pi: integer used for iteration* This must be called either with wq_pool_mutex held or RCU read* locked. If the pool needs to be used beyond the locking in effect, the(pool, pi)
4782  bool first = true
4784  spin_lock_irqsave( & he pool lock , flags)
4785  如果L: total number of workers 恒等于L: currently idle workers 则转到:next_pool
4788  打印信息("pool %d:", I: pool ID )
4789  pr_cont_pool_info(pool)
4790  打印标准信息(" hung=%us workers=%d", Convert various time units to each other: / 1000, L: total number of workers )
4793  如果L: purely informational 打印标准信息(" manager: %d", task_pid_nr(I: worker task ))
4797  打印标准信息(" %s%d", first ? "idle: " : "", task_pid_nr(I: worker task ))
4799  first = false
4801  打印标准信息("\n")
4802  next_pool :
4803  spin_unlock_irqrestore( & he pool lock , flags)
4809  h_nmi_watchdog - restart NMI watchdog timeout.* If the architecture supports the NMI watchdog, touch_nmi_watchdog()* may be used to reset the timeout - for code which intentionally* disables interrupts for a long time. This call is stateless.
4812  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
调用者
名称描述
destroy_workqueuedestroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
try_to_freeze_tasks