Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The core wakeup function

Proto: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)

Type:int

Parameter:

TypeParameterName
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  If bookmark && flags & WQ_FLAG_BOOKMARK Then
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  deletes entry from list
79  flags = 0
80  Else 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  If entry == head Then Return nr_exclusive
87  flags = flags
90  If flags & WQ_FLAG_BOOKMARK Then Continue
93  ret = func(curr, mode, wake_flags, key)
94  If ret < 0 Then Break
96  If ret && flags & wait_queue_entry::flags && Not --nr_exclusive Then Break
99  If bookmark && ++cnt > 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 Then
101  flags = WQ_FLAG_BOOKMARK
102  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
103  Break
107  Return nr_exclusive
Caller
NameDescribe
__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