Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\rtmutex.c Create Date:2022-07-28 09:52:21
Last Modify:2020-03-17 14:26:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Slow path lock function:

Proto:static int __sched rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk)

Type:int

Parameter:

TypeParameterName
struct rt_mutex *lock
intstate
struct hrtimer_sleeper *timeout
enum rtmutex_chainwalkchwalk
1236  ret = 0
1238  rt_mutex_init_waiter( & waiter)
1248  raw_spin_lock_irqsave( & wait_lock, flags)
1251  If Try to take an rt-mutex* Must be called with lock->wait_lock held and interrupts disabled*@lock: The lock to be acquired Then
1252  raw_spin_unlock_irqrestore( & wait_lock, flags)
1253  Return 0
1256  set_current_state(state)
1259  If Value for the false possibility is greater at compile time(timeout) Then hrtimer_start_expires( & timer, HRTIMER_MODE_ABS)
1262  ret = Task blocks on lock.* Prepare waiter and propagate pi chain* This must be called with lock->wait_lock held and interrupts disabled
1264  If Value is more likely to compile time(!ret) Then ret = __rt_mutex_slowlock() - Perform the wait-wake-try-to-take loop*@lock: the rt_mutex to take*@state: the state the task should block in (TASK_INTERRUPTIBLE* or TASK_UNINTERRUPTIBLE)*@timeout: the pre-initialized and started timer, or NULL for none*@waiter:
1268  If Value for the false possibility is greater at compile time(ret) Then
1269  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (Used in tsk->state: )
1270  Remove a waiter from a lock and give up* Must be called with lock->wait_lock held and interrupts disabled. I must* have just failed to try_to_take_rt_mutex().
1271  rt_mutex_handle_deadlock(ret, chwalk, & waiter)
1278  fixup_rt_mutex_waiters(lock)
1280  raw_spin_unlock_irqrestore( & wait_lock, flags)
1283  If Value for the false possibility is greater at compile time(timeout) Then hrtimer_cancel( & timer)
1286  debug_rt_mutex_free_waiter( & waiter)
1288  Return ret