函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\mutex.c Create Date:2022-07-27 10:47:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Check the wound condition for the current lock acquire

函数原型:static inline int __sched __ww_mutex_check_kill(struct mutex *lock, struct mutex_waiter *waiter, struct ww_acquire_ctx *ctx)

返回类型:int

参数:

类型参数名称
struct mutex *lock
struct mutex_waiter *waiter
struct ww_acquire_ctx *ctx
808  ww等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(lock, structww_mutex, base)
809  hold_ctx等于READ_ONCE(ctx)
812  如果acquired恒等于0则返回:0
815  如果非is_wait_die
816  如果wounded则返回:__ww_mutex_kill(lock, ctx)
819  返回:0
822  如果hold_ctxDetermine 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.则返回:__ww_mutex_kill(lock, ctx)
829  cur等于waiter
831  如果非ww_ctx则继续下一循环
834  返回:__ww_mutex_kill(lock, ctx)
837  返回:0
调用者
名称描述
__mutex_lock_commonLock a mutex (possibly interruptible), slowpath: