函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:drain_workqueue - drain a workqueue*@wq: workqueue to drain* Wait until the workqueue becomes empty. While draining is in progress,* only chain queueing is allowed. IOW, only currently pending or running

函数原型:void drain_workqueue(struct workqueue_struct *wq)

返回类型:void

参数:

类型参数名称
struct workqueue_struct *wq
2927  flush_cnt等于0
2935  mutex_lock( & protects this wq )
2936  如果非WQ: drain in progress 自加则hot fields used during command issue, aligned to cacheline 或等于__WQ_DRAINING
2938  mutex_unlock( & protects this wq )
2939  reflush :
2940  lush_workqueue - ensure that any scheduled work has run to completion.*@wq: workqueue to flush* This function sleeps until all work items which were queued on entry* have finished execution, but it is not livelocked by new incoming ones.
2942  mutex_lock( & protects this wq )
2944  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)
2947  spin_lock_irq( & he pool lock )
2948  drained等于非L: nr of active works 链表为空
2949  spin_unlock_irq( & he pool lock )
2951  如果drained则继续下一循环
2954  如果flush_cnt先自加恒等于10或flush_cnt取模100恒等于0且flush_cnt小于等于1000则打印警告信息("workqueue %s: drain_workqueue() isn't complete after %u tries\n", I: workqueue name , flush_cnt)
2959  mutex_unlock( & protects this wq )
2960  转到:reflush
2963  如果非WQ: drain in progress 先自减则hot fields used during command issue, aligned to cacheline 与等于__WQ_DRAINING的反
2965  mutex_unlock( & protects this wq )
调用者
名称描述
destroy_workqueuedestroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.