函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:The core wakeup function

函数原型:static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode, int nr_exclusive, int wake_flags, void *key, wait_queue_entry_t *bookmark)

返回类型:int

参数:

类型参数名称
struct wait_queue_head *wq_head
unsigned intmode
intnr_exclusive
intwake_flags
void *key
wait_queue_entry_t *bookmark
71  cnt等于0
73  lockdep_assert_held( & lock)
75  如果bookmarkflags按位与WQ_FLAG_BOOKMARK
76  curr等于list_next_entry - get the next element in list*@pos: the type * to cursor*@member: the name of the list_head within the struct.(bookmark, entry)
78  删除链表项
79  flags等于0
80  否则curr等于list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.( & head, wait_queue_entry_t, entry)
83  如果entry恒等于head则返回:nr_exclusive
87  flags等于flags
90  如果flags按位与WQ_FLAG_BOOKMARK则继续下一循环
93  ret等于func(curr, mode, wake_flags, key)
94  如果ret小于0则退出
96  如果retflags按位与wait_queue_entry::flags 且非nr_exclusive先自减则退出
99  如果bookmarkcnt先自加大于Scan threshold to break wait queue walk.* This allows a waker to take a break from holding the* wait queue lock during the wait queue walk.entry不等于head
101  flags等于WQ_FLAG_BOOKMARK
102  添加链表项
103  退出
107  返回:nr_exclusive
调用者
名称描述
__wake_up_common_lock
__wake_up_lockedSame as __wake_up but called with the spinlock in wait_queue_head_t held.
__wake_up_locked_key
__wake_up_locked_key_bookmark
__wake_up_locked_sync_key__wake_up_locked_sync_key - wake up a thread blocked on a locked waitqueue