函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Caller must hold a reference on @pi_state.

函数原型:static int wake_futex_pi(unsigned int __user *uaddr, unsigned int uval, struct futex_pi_state *pi_state)

返回类型:int

参数:

类型参数名称
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  如果WARN_ON_ONCE(!new_owner)则
1570  ret等于负EAGAIN
1571  转到:out_unlock
1579  newval等于Are there any waiters for this robust futex:按位或task_pid_vnr(new_owner)
1581  如果此条件成立可能性小(为编译器优化)(should_fail_futex(true))则ret等于负EFAULT
1584  ret等于cmpxchg_futex_value_locked( & curval, uaddr, uval, newval)
1585  如果非retcurval不等于uval
1592  如果The rest of the robust-futex field is for the TID:按位与curval的值恒等于uvalret等于负EAGAIN
1594  否则ret等于负EINVAL
1598  如果ret则转到:out_unlock
1606  raw_spin_lock( & Protection of the PI data structures: )
1607  WARN_ON(链表为空)
1608  删除链表项并重新初始化
1609  raw_spin_unlock( & Protection of the PI data structures: )
1611  raw_spin_lock( & Protection of the PI data structures: )
1612  WARN_ON(!链表为空)
1613  添加链表项
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( & 保护自旋锁)
1622  如果postunlockPerforms the wakeup of the the top-waiter and re-enables preemption.
1625  返回:ret
调用者
名称描述
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.