Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Releases the lock. The caller should pass in the corresponding node that* was used to acquire the lock.

Proto:static inline void mcs_spin_unlock(struct mcs_spinlock **lock, struct mcs_spinlock *node)

Type:void

Parameter:

TypeParameterName
struct mcs_spinlock **lock
struct mcs_spinlock *node
104  next = READ_ONCE(next)
106  If Value is more likely to compile time(!next) Then
110  If Value is more likely to compile time(cmpxchg_release(lock, node, NULL) == node) Then Return
113  When Not (next = READ_ONCE(next)) cycle
114  cpu_relax()
118  smp_store_release() provides a memory barrier to ensure all* operations in the critical section has been completed before* unlocking.( & 1 if lock acquired )