Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Try to take an rt-mutex* Must be called with lock->wait_lock held and interrupts disabled*@lock: The lock to be acquired

Proto:static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, struct rt_mutex_waiter *waiter)

Type:int

Parameter:

TypeParameterName
struct rt_mutex *lock
struct task_struct *task
struct rt_mutex_waiter *waiter
810  lockdep_assert_held( & wait_lock)
829  Callers must hold the ->wait_lock -- which is the whole purpose as we force* all future threads that attempt to [Rmw] the lock to the slowpath. As such* relaxed semantics suffice.
834  If rt_mutex_owner(lock) Then Return 0
842  If waiter Then
847  If waiter != rt_mutex_top_waiter(lock) Then Return 0
854  rt_mutex_dequeue(lock, waiter)
856  Else
865  If rt_mutex_has_waiters(lock) Then
880  Else
887  Go to takeit
897  raw_spin_lock( & Protection of the PI data structures: )
898  pi_blocked_on = NULL
904  If rt_mutex_has_waiters(lock) Then rt_mutex_enqueue_pi(task, rt_mutex_top_waiter(lock))
906  raw_spin_unlock( & Protection of the PI data structures: )
908  takeit :
910  debug_rt_mutex_lock(lock)
916  lock->owner state tracking:* is used to keep track of the "lock has waiters" state
918  Return 1
Caller
NameDescribe
__rt_mutex_slowlock__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:
rt_mutex_slowlockSlow path lock function:
__rt_mutex_slowtrylock
__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
rt_mutex_cleanup_proxy_lock_mutex_cleanup_proxy_lock() - Cleanup failed lock acquisition*@lock: the rt_mutex we were woken on*@waiter: the pre-initialized rt_mutex_waiter* Attempt to clean up after a failed __rt_mutex_start_proxy_lock() or* rt_mutex_wait_proxy_lock()