函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lush_workqueue_prep_pwqs - prepare pwqs for workqueue flushing*@wq: workqueue being flushed*@flush_color: new flush color, < 0 for no-op*@work_color: new work color, < 0 for no-op* Prepare pwqs for workqueue flushing

函数原型:static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, int flush_color, int work_color)

返回类型:bool

参数:

类型参数名称
struct workqueue_struct *wq
intflush_color
intwork_color
2719  bool wait = false
2722  如果flush_color大于等于0则
2723  WARN_ON_ONCE(atomic_read( & lush in progress ))
2724  atomic_set( & lush in progress , 1)
2727  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)
2728  pool等于I: the associated pool
2730  spin_lock_irq( & he pool lock )
2732  如果flush_color大于等于0则
2735  如果nr_in_flight[flush_color]则
2738  wait = true
2742  如果work_color大于等于0则
2747  spin_unlock_irq( & he pool lock )
2750  如果flush_color大于等于0且atomic_dec_and_test( & lush in progress )则complete( & lush completion )
2753  返回:wait
调用者
名称描述
flush_workqueuelush_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.