Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:downgrade write lock to read lock

Proto:static inline void __downgrade_write(struct rw_semaphore *sem)

Type:void

Parameter:

TypeParameterName
struct rw_semaphore *sem
1482  tmp = atomic_long_fetch_add_release( - On 64-bit architectures, the bit definitions of the count are:* Bit 0 - writer locked bit* Bit 1 - waiters present bit* Bit 2 - lock handoff bit* Bits 3-7 - reserved* Bits 8-62 - 55-bit reader count* Bit 63 - read fail bit* On 32-bit architectures, the + RWSEM_READER_BIAS, & count)
1484  rwsem_set_reader_owned(sem)
1485  If tmp & RWSEM_FLAG_WAITERS Then downgrade a write lock into a read lock* - caller incremented waiting part of count and discovered it still negative* - just wake up any readers at the front of the queue
Caller
NameDescribe
downgrade_writedowngrade write lock to read lock