Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__down_write_trylock

Proto:static inline int __down_write_trylock(struct rw_semaphore *sem)

Type:int

Parameter:

TypeParameterName
struct rw_semaphore *sem
1417  tmp = RWSEM_UNLOCKED_VALUE
1418  If atomic_long_try_cmpxchg_acquire( & count, & tmp, 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 ) Then
1420  All writes to owner are protected by WRITE_ONCE() to make sure that* store tearing can't happen as optimistic spinners may read and use* the owner value concurrently without lock
1421  Return true
1423  Return false
Caller
NameDescribe
down_write_trylockrylock for writing -- returns 1 if successful, 0 if contention