Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Wound-Wait; wound a younger @hold_ctx if it holds the lock.* Wound the lock holder if there are waiters with older transactions than* the lock holders. Even if multiple waiters may wound the lock holder,* it's sufficient that only one does.

Proto:static bool __ww_mutex_wound(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, struct ww_acquire_ctx *hold_ctx)

Type:bool

Parameter:

TypeParameterName
struct mutex *lock
struct ww_acquire_ctx *ww_ctx
struct ww_acquire_ctx *hold_ctx
393  owner = Internal helper function; C doesn't allow us to hide it :/* DO NOT USE (outside of mutex code).
395  lockdep_assert_held( & wait_lock)
402  If Not hold_ctx Then Return false
410  If Not owner Then Return false
413  If acquired > 0 && Determine if context @a is 'after' context @b. IOW, @a is a younger* transaction than @b and depending on algorithm either needs to wait for*@b or die. Then
414  wounded = 1
422  If owner != current process Then wake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
425  Return true
428  Return false
Caller
NameDescribe
__ww_mutex_check_waitersWe 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
__ww_mutex_add_waiterAdd @waiter to the wait-list, keep the wait-list ordered by stamp, smallest* first