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:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:osq_unlock

Proto:void osq_unlock(struct optimistic_spin_queue *lock)

Type:void

Parameter:

TypeParameterName
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  If Value is more likely to compile time(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) Then Return
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  If next Then
224  WRITE_ONCE(1 if lock acquired , 1)
225  Return
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  If next Then WRITE_ONCE(1 if lock acquired , 1)