Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\workqueue.c Create Date:2022-07-28 09:28:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:void show_workqueue_state(void)

Type:void

Parameter:Nothing

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  pr_info("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)
4757  idle = false
4758  Break
4761  If idle Then Continue
4764  pr_info("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  If L: nr of active works || Not list_empty - tests whether a list is empty*@head: the list to test. Then 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  If L: total number of workers == L: currently idle workers Then Go to next_pool
4788  pr_info("pool %d:", I: pool ID )
4789  pr_cont_pool_info(pool)
4790  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" hung=%us workers=%d", Convert various time units to each other: / 1000, L: total number of workers )
4793  If L: purely informational Then Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" manager: %d", task_pid_nr(I: worker task ))
4797  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" %s%d", first ? "idle: " : "", task_pid_nr(I: worker task ))
4799  first = false
4801  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\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()
Caller
NameDescribe
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