Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-28 10:54:44
Last Modify:2020-03-17 15:28:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static int futex_unlock_pi(unsigned int __user *uaddr, unsigned int flags)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intflags
3070  curval = curval , vpid = task_pid_vnr(current process)
3071  key = FUTEX_KEY_INIT
3076  If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI) Then Return -ENOSYS
3079  retry :
3080  If Get a simple variable from user space(uval, uaddr) Then Return -EFAULT
3085  If (uval & The rest of the robust-futex field is for the TID:) != vpid Then Return -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  If ret Then Return 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  spin_lock( & lock)
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  If top_waiter Then
3102  pi_state = pi_state
3104  ret = -EINVAL
3105  If Not pi_state Then Go to out_unlock
3112  If owner != current process Then Go to out_unlock
3115  get_pi_state(pi_state)
3126  raw_spin_lock_irq( & wait_lock)
3127  spin_unlock( & lock)
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  If Not ret Then Go to out_putkey
3143  If ret == -EFAULT Then Go to pi_faulted
3149  If ret == -EAGAIN Then Go to pi_retry
3155  Go to out_putkey
3165  If ret = cmpxchg_futex_value_locked( & curval, uaddr, uval, 0) Then
3166  spin_unlock( & lock)
3168  Case ret == -EFAULT
3169  Go to pi_faulted
3171  Case ret == -EAGAIN
3172  Go to pi_retry
3174  Default
3175  WARN_ON_ONCE(1)
3176  Go to out_putkey
3183  ret = If curval == uval Then 0 Else -EAGAIN
3185  out_unlock :
3186  spin_unlock( & lock)
3187  out_putkey :
3188  put_futex_key( & key)
3189  Return ret
3191  pi_retry :
3192  put_futex_key( & key)
3193  cond_resched()
3194  Go to 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  If Not ret Then Go to retry
3203  Return ret
Caller
NameDescribe
do_futex