函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static inline struct optimistic_spin_node *osq_wait_next(struct optimistic_spin_queue *lock, struct optimistic_spin_node *node, struct optimistic_spin_node *prev)

返回类型:struct optimistic_spin_node

参数:

类型参数名称
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等于如果prevcoded CPU # + 1 value 否则OSQ_UNLOCKED_VAL
57  循环
65  退出
78  如果next
79  next等于xchg( & next, NULL)
80  如果next退出
84  cpu_relax()
87  返回:next
调用者
名称描述
osq_lock
osq_unlock