Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Get a stable @node->next pointer, either for unlock() or unqueue() purposes.* Can return NULL in case we were the last queued and we updated @lock instead.

Proto:static inline struct optimistic_spin_node *osq_wait_next(struct optimistic_spin_queue *lock, struct optimistic_spin_node *node, struct optimistic_spin_node *prev)

Type:struct optimistic_spin_node

Parameter:

TypeParameterName
struct optimistic_spin_queue *lock
struct optimistic_spin_node *node
struct optimistic_spin_node *prev
46  struct optimistic_spin_node * next = NULL
47  curr = We use the value 0 to represent "no CPU", thus the encoded value* will be the CPU number incremented by 1.
55  old = If prev Then coded CPU # + 1 value Else OSQ_UNLOCKED_VAL
57  cycle
65  Break
78  If next Then
79  next = xchg( & next, NULL)
80  If next Then Break
84  cpu_relax()
87  Return next
Caller
NameDescribe
osq_lock
osq_unlock