函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Userspace attempted a TID -> 0 atomic transition, and failed.* This is the in-kernel slowpath: we look up the PI state (if any),* and do the rt-mutex unlock.

函数原型:static int futex_unlock_pi(unsigned int __user *uaddr, unsigned int flags)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr
unsigned intflags
3070  curval等于curval, vpid等于task_pid_vnr(当前进程)
3071  key等于FUTEX_KEY_INIT
3076  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI)则返回:负ENOSYS
3079  retry :
3080  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(uval, uaddr)则返回:负EFAULT
3085  如果uval按位与The rest of the robust-futex field is for the TID:的值不等于vpid则返回:负EPERM
3088  ret等于get_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
3089  如果ret则返回:ret
3092  hb等于hash_futex - Return the hash bucket in the global hash*@key: Pointer to the futex key for which the hash is calculated* We hash on the keys returned from get_futex_key (see below) and return the* corresponding hash bucket in the global hash.
3093  加自旋锁
3100  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.
3101  如果top_waiter
3102  pi_state等于pi_state
3104  ret等于负EINVAL
3105  如果非pi_state则转到:out_unlock
3112  如果owner不等于当前进程则转到:out_unlock
3115  get_pi_state(pi_state)
3126  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & 保护自旋锁)
3127  自旋锁解锁
3130  ret等于Caller must hold a reference on @pi_state.
3132  Drops a reference to the pi_state object and frees or caches it* when the last reference is gone.
3137  如果非ret则转到:out_putkey
3143  如果ret恒等于负EFAULT则转到:pi_faulted
3149  如果ret恒等于负EAGAIN则转到:pi_retry
3155  转到:out_putkey
3165  如果ret等于cmpxchg_futex_value_locked( & curval, uaddr, uval, 0)则
3166  自旋锁解锁
3168  :ret恒等于负EFAULT
3169  转到:pi_faulted
3171  :ret恒等于负EAGAIN
3172  转到:pi_retry
3174  默认
3175  WARN_ON_ONCE(1)
3176  转到:out_putkey
3183  ret等于如果curval恒等于uval则0否则负EAGAIN
3185  out_unlock :
3186  自旋锁解锁
3187  out_putkey :
3188  put_futex_key( & key)
3189  返回:ret
3191  pi_retry :
3192  put_futex_key( & key)
3193  cond_resched()
3194  转到:retry
3196  pi_faulted :
3197  put_futex_key( & key)
3199  ret等于ault_in_user_writeable() - Fault in user address and verify RW access*@uaddr: pointer to faulting user space address* Slow path to fixup the fault we just took in the atomic write* access to @uaddr
3200  如果非ret则转到:retry
3203  返回:ret
调用者
名称描述
do_futex