函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-27 11:53:51
Last Modify:2020-03-17 15:28:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ex_lock_pi_atomic() - Atomic work required to acquire a pi aware futex*@uaddr: the pi futex user address*@hb: the pi futex hash bucket*@key: the futex key associated with uaddr and hb*@ps: the pi_state pointer where we store the result of the* lookup

函数原型:static int futex_lock_pi_atomic(unsigned int __user *uaddr, struct futex_hash_bucket *hb, union futex_key *key, struct futex_pi_state **ps, struct task_struct *task, struct task_struct **exiting, int set_waiters)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr
struct futex_hash_bucket *hb
union futex_key *key
struct futex_pi_state **ps
struct task_struct *task
struct task_struct **exiting
intset_waiters
1428  vpid等于task_pid_vnr(task)
1436  如果get_futex_value_locked( & uval, uaddr)则返回:负EFAULT
1439  如果此条件成立可能性小(为编译器优化)(should_fail_futex(true))则返回:负EFAULT
1445  如果此条件成立可能性小(为编译器优化)((uval & The rest of the robust-futex field is for the TID:) == vpid)则返回:负EDEADLK
1448  如果此条件成立可能性小(为编译器优化)(should_fail_futex(true))则返回:负EDEADLK
1455  top_waiter等于ex_top_waiter() - Return the highest priority waiter on a futex*@hb: the hash bucket the futex_q's reside in*@key: the futex key (to distinguish it from other futex futex_q's)* Must be called with the hb lock held.
1456  如果top_waiter则返回:Validate that the existing waiter has a pi_state and sanity check* the pi_state against the user space value. If correct, attach to* it.
1465  如果非uval按位与The rest of the robust-futex field is for the TID:的值则
1470  newval等于uval按位与The kernel signals via this bit that a thread holding a futex* has exited without unlocking the futex. The kernel also does* a FUTEX_WAKE on such futexes, after setting the bit, to wake* up any possible waiters:
1471  newval或等于vpid
1474  如果set_waitersnewval或等于Are there any waiters for this robust futex:
1477  ret等于lock_pi_update_atomic(uaddr, uval, newval)
1479  返回:如果ret小于0则ret否则1
1487  newval等于uval按位或Are there any waiters for this robust futex:
1488  ret等于lock_pi_update_atomic(uaddr, uval, newval)
1489  如果ret则返回:ret
1496  返回:Lookup the task for the TID provided from user space and attach to* it after doing proper sanity checks.
调用者
名称描述
futex_proxy_trylock_atomicex_proxy_trylock_atomic() - Attempt an atomic lock for the top waiter*@pifutex: the user address of the to futex*@hb1: the from futex hash bucket, must be locked by the caller*@hb2: the to futex hash bucket, must be locked by the caller*@key1: the from
futex_lock_piUserspace tried a 0 -> TID atomic transition of the futex value* and failed. The kernel side here does the whole locking operation:* if there are waiters then it will block as a consequence of relying* on rt-mutexes, it does PI, etc