函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\rtmutex.c Create Date:2022-07-27 10:52:28
Last Modify:2020-03-17 14:26:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Task blocks on lock.* Prepare waiter and propagate pi chain* This must be called with lock->wait_lock held and interrupts disabled

函数原型:static int task_blocks_on_rt_mutex(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct task_struct *task, enum rtmutex_chainwalk chwalk)

返回类型:int

参数:

类型参数名称
struct rt_mutex *lock
struct rt_mutex_waiter *waiter
struct task_struct *task
enum rtmutex_chainwalkchwalk
933  owner等于rt_mutex_owner(lock)
934  top_waiter等于waiter
936  chain_walk等于0
938  lockdep_assert_held( & 保护自旋锁)
949  如果owner恒等于task则返回:负EDEADLK
952  raw_spin_lock( & Protection of the PI data structures: )
953  等待进程等于task
954  lock等于lock
955  prio等于prio
956  deadline等于 Absolute deadline for this instance
959  如果rt_mutex_has_waiters(lock)则top_waiter等于rt_mutex_top_waiter(lock)
961  rt_mutex_enqueue(lock, waiter)
963  pi_blocked_on等于waiter
965  raw_spin_unlock( & Protection of the PI data structures: )
967  如果非owner则返回:0
970  raw_spin_lock( & Protection of the PI data structures: )
971  如果waiter恒等于rt_mutex_top_waiter(lock)则
972  rt_mutex_dequeue_pi(owner, top_waiter)
973  rt_mutex_enqueue_pi(owner, waiter)
975  rt_mutex_adjust_prio(owner)
976  如果pi_blocked_onchain_walk等于1
978  否则如果Deadlock detection is conditional:* If CONFIG_DEBUG_RT_MUTEXES=n, deadlock detection is only conducted* if the detect argument is == RT_MUTEX_FULL_CHAINWALK.* If CONFIG_DEBUG_RT_MUTEXES=y, deadlock detection is always
979  chain_walk等于1
983  next_lock等于task_blocked_on_lock(owner)
985  raw_spin_unlock( & Protection of the PI data structures: )
991  如果非chain_walk或非next_lock则返回:0
999  get_task_struct(owner)
1001  raw_spin_unlock_irq( & 保护自旋锁)
1003  res等于Adjust the priority chain
1006  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & 保护自旋锁)
1008  返回:res
调用者
名称描述
rt_mutex_slowlockSlow path lock function:
__rt_mutex_start_proxy_lock__rt_mutex_start_proxy_lock() - Start lock acquisition for another task*@lock: the rt_mutex to take*@waiter: the pre-initialized rt_mutex_waiter*@task: the task to prepare* Starts the rt_mutex acquire; it enqueues the @waiter and does deadlock* detection