函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:fixup_pi_state_owner

函数原型:static int fixup_pi_state_owner(unsigned int __user *uaddr, struct futex_q *q, struct task_struct *argowner)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr
struct futex_q *q
struct task_struct *argowner
2443  pi_state等于pi_state
2444  curval等于curval
2447  err等于0
2449  lockdep_assert_held(lock_ptr)
2451  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & 保护自旋锁)
2453  oldowner等于owner
2478  retry :
2479  如果非argowner
2480  如果oldowner不等于当前进程
2485  ret等于0
2486  转到:out_unlock
2491  ret等于0
2492  转到:out_unlock
2498  newowner等于rt_mutex_owner( & The PI object:)
2499  BUG_ON(!newowner)
2500  否则
2501  WARN_ON_ONCE(argowner != 当前进程)
2502  如果oldowner恒等于当前进程
2507  ret等于0
2508  转到:out_unlock
2510  newowner等于argowner
2513  newtid等于task_pid_vnr(newowner)按位或Are there any waiters for this robust futex:
2515  如果非ownernewtid或等于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:
2518  err等于get_futex_value_locked( & uval, uaddr)
2519  如果err则转到:handle_err
2522  循环
2523  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:按位或newtid
2525  err等于cmpxchg_futex_value_locked( & curval, uaddr, uval, newval)
2526  如果err则转到:handle_err
2529  如果curval恒等于uval退出
2531  uval等于curval
2538  如果(owner != NULL)则
2539  raw_spin_lock( & Protection of the PI data structures: )
2540  WARN_ON(链表为空)
2541  删除链表项并重新初始化
2542  raw_spin_unlock( & Protection of the PI data structures: )
2545  owner等于newowner
2547  raw_spin_lock( & Protection of the PI data structures: )
2548  WARN_ON(!链表为空)
2549  添加链表项
2550  raw_spin_unlock( & Protection of the PI data structures: )
2551  raw_spin_unlock_irq( & 保护自旋锁)
2553  返回:0
2568  handle_err :
2569  raw_spin_unlock_irq( & 保护自旋锁)
2570  自旋锁解锁
2573  :err恒等于负EFAULT
2574  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
2575  退出
2577  :err恒等于负EAGAIN
2578  cond_resched()
2579  ret等于0
2580  退出
2582  默认
2583  WARN_ON_ONCE(1)
2584  ret等于err
2585  退出
2588  加自旋锁
2589  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & 保护自旋锁)
2594  如果owner不等于oldowner
2595  ret等于0
2596  转到:out_unlock
2599  如果ret则转到:out_unlock
2602  转到:retry
2604  out_unlock :
2605  raw_spin_unlock_irq( & 保护自旋锁)
2606  返回:ret
调用者
名称描述
fixup_ownerxup_owner() - Post lock pi_state and corner case management*@uaddr: user address of the futex*@q: futex_q (contains pi_state and access to the rt_mutex)*@locked: if the attempt to take the rt_mutex succeeded (1) or not (0)* After attempting to lock an
futex_wait_requeue_piex_wait_requeue_pi() - Wait on uaddr and take uaddr2*@uaddr: the futex we initially wait on (non-pi)*@flags: futex flags (FLAGS_SHARED, FLAGS_CLOCKRT, etc