Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:After acquiring lock with fastpath, where we do not hold wait_lock, set ctx* and wake up any waiters so they can recheck.

Proto:static __always_inline void ww_mutex_set_context_fastpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)

Type:void

Parameter:

TypeParameterName
struct ww_mutex *lock
struct ww_acquire_ctx *ctx
467  Associate the ww_mutex @ww with the context @ww_ctx under which we acquired* it.
476  smp_mb()
487  If Value is more likely to compile time(!(atomic_long_read( & owner) & @owner: contains: 'struct task_struct *' to the current lock owner,* NULL means not owned. Since task_struct pointers are aligned at* at least L1_CACHE_BYTES, we have low bits to store extra state.)) Then Return
494  spin_lock( & wait_lock)
495  We just acquired @lock under @ww_ctx, if there are later contexts waiting* behind us on the wait-list, check if they need to die, or wound us.* See __ww_mutex_add_waiter() for the list-order construction; basically the
496  spin_unlock( & wait_lock)
Caller
NameDescribe
__mutex_lock_commonLock a mutex (possibly interruptible), slowpath: