函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:osq_unlock

函数原型:void osq_unlock(struct optimistic_spin_queue *lock)

返回类型:void

参数:

类型参数名称
struct optimistic_spin_queue *lock
209  curr等于We use the value 0 to represent "no CPU", thus the encoded value* will be the CPU number incremented by 1.
214  如果此条件成立可能性大(为编译器优化)(atomic_cmpxchg_release( & * Stores an encoded value of the CPU # of the tail node in the queue. * If the queue is empty, then it's set to OSQ_UNLOCKED_VAL., curr, OSQ_UNLOCKED_VAL) == curr)则返回
221  node等于this_cpu_ptr( & An MCS like lock especially tailored for optimistic spinning for sleeping* lock implementations (mutex, rwsem, etc))
222  next等于xchg( & next, NULL)
223  如果next
224  WRITE_ONCE(1 if lock acquired , 1)
225  返回
228  next等于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.
229  如果nextWRITE_ONCE(1 if lock acquired , 1)