函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

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

返回类型:void

参数:

类型参数名称
struct workqueue_struct *wq
2765  struct wq_flusher this_flusher = {WQ: list of flushers = Simple doubly linked list implementation(list), WQ: flush color waiting for = - 1, lush completion = COMPLETION_INITIALIZER_ONSTACK_MAP(done, lockdep_map), }
2772  如果WARN_ON(!can kworkers be created yet? )则返回
2775  lock_map_acquire( & lockdep_map)
2776  lock_map_release( & lockdep_map)
2778  mutex_lock( & protects this wq )
2783  next_color等于work_next_color(WQ: current work color )
2785  如果next_color不等于WQ: current flush color
2791  WARN_ON_ONCE(!链表为空)
2792  WQ: flush color waiting for 等于WQ: current work color
2793  WQ: current work color 等于next_color
2795  如果非WQ: first flusher
2805  WQ: first flusher = NULL
2806  转到:out_unlock
2808  否则
2814  否则
2820  添加链表项
2823  heck_flush_dependency - check for flush dependency sanity*@target_wq: workqueue being flushed*@target_work: work item being flushed (NULL for workqueue flushes)* %current is trying to flush the whole @target_wq or @target_work on it
2825  mutex_unlock( & protects this wq )
2827  wait_for_completion( & lush completion )
2835  如果WQ: first flusher 不等于this_flusher则返回
2838  mutex_lock( & protects this wq )
2841  如果WQ: first flusher 不等于this_flusher则转到:out_unlock
2844  WQ: first flusher = NULL
2846  WARN_ON_ONCE(!链表为空)
2847  WARN_ON_ONCE(WQ: current flush color != WQ: flush color waiting for )
2849  当(true)循环
2854  如果WQ: flush color waiting for 不等于WQ: current flush color 退出
2856  删除链表项并重新初始化
2857  complete( & lush completion )
2860  WARN_ON_ONCE(!链表为空 && WQ: current flush color != work_next_color(WQ: current work color ))
2864  WQ: current flush color 等于work_next_color(WQ: current flush color )
2867  如果非链表为空
2874  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(tmp, & WQ: flush overflow list , list)
2875  WQ: flush color waiting for 等于WQ: current work color
2877  WQ: current work color 等于work_next_color(WQ: current work color )
2879  加入二个链表项并重新初始化
2881  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
2884  如果链表为空
2885  WARN_ON_ONCE(WQ: current flush color != WQ: current work color )
2886  退出
2893  WARN_ON_ONCE(WQ: current flush color == WQ: current work color )
2894  WARN_ON_ONCE(WQ: current flush color != WQ: flush color waiting for )
2896  删除链表项并重新初始化
2897  WQ: first flusher 等于next
2899  如果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退出
2906  WQ: first flusher = NULL
2909  out_unlock :
2910  mutex_unlock( & protects this wq )
调用者
名称描述
drain_workqueuedrain_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
__test_cycle
stress
cgroup1_pidlist_destroy_allUsed to destroy all pidlists lingering waiting for destroy timer. None* should be left afterwards.
cpuset_post_attach
cpuset_write_resmaskCommon handling for a write to a "cpus" or "mems" file.
flush_scheduled_worklush_scheduled_work - ensure that any scheduled work has run to completion.* Forces execution of the kernel-global workqueue and blocks until its* completion.* Think twice before calling this function! It's very easy to get into
blk_flush_integrity