Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Caller must hold a reference on @pi_state.

Proto:static int wake_futex_pi(unsigned int __user *uaddr, unsigned int uval, struct futex_pi_state *pi_state)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intuval
struct futex_pi_state *pi_state
1554  curval = curval
1556  bool postunlock = false
1558  ret = 0
1560  new_owner = _mutex_next_owner - return the next owner of the lock*@lock: the rt lock query* Returns the next owner of the lock or NULL* Caller has to serialize against other accessors to the lock* itself.* Special API call for PI-futex support
1561  If WARN_ON_ONCE(!new_owner) Then
1570  ret = -EAGAIN
1571  Go to out_unlock
1579  newval = Are there any waiters for this robust futex: | task_pid_vnr(new_owner)
1581  If Value for the false possibility is greater at compile time(should_fail_futex(true)) Then ret = -EFAULT
1584  ret = cmpxchg_futex_value_locked( & curval, uaddr, uval, newval)
1585  If Not ret && curval != uval Then
1592  If (The rest of the robust-futex field is for the TID: & curval) == uval Then ret = -EAGAIN
1594  Else ret = -EINVAL
1598  If ret Then Go to out_unlock
1606  raw_spin_lock( & Protection of the PI data structures: )
1607  WARN_ON(list_empty - tests whether a list is empty*@head: the list to test.)
1608  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1609  raw_spin_unlock( & Protection of the PI data structures: )
1611  raw_spin_lock( & Protection of the PI data structures: )
1612  WARN_ON(!list_empty - tests whether a list is empty*@head: the list to test.)
1613  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1614  owner = new_owner
1615  raw_spin_unlock( & Protection of the PI data structures: )
1617  postunlock = Futex variant, that since futex variants do not use the fast-path, can be* simple and will not need to retry.
1619  out_unlock :
1620  raw_spin_unlock_irq( & wait_lock)
1622  If postunlock Then Performs the wakeup of the the top-waiter and re-enables preemption.
1625  Return ret
Caller
NameDescribe
futex_unlock_piUserspace 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.