函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\mutex.c Create Date:2022-07-27 10:47:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__mutex_unlock_slowpath

函数原型:static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigned long ip)

返回类型:void

参数:

类型参数名称
struct mutex *lock
unsigned longip
1224  struct task_struct * next = NULL
1228  mutex_release( & dep_map, ip)
1237  owner等于atomic_long_read( & owner)
1238  循环
1246  如果owner按位与MUTEX_FLAG_HANDOFF退出
1249  old等于atomic_long_cmpxchg_release( & owner, owner, __owner_flags(owner))
1251  如果old恒等于owner
1255  返回
1258  owner等于old
1261  加自旋锁
1262  debug_mutex_unlock(lock)
1263  如果非链表为空
1265  waiter等于list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.( & wait_list, structmutex_waiter, list)
1269  next等于task
1271  debug_mutex_wake_waiter(lock, waiter)
1272  wake_q_add() - queue a wakeup for 'later' waking
1275  如果owner按位与MUTEX_FLAG_HANDOFFGive up ownership to a specific task, when @task = NULL, this is equivalent* to a regular unlock. Sets PICKUP on a handoff, clears HANDOF, preserves* WAITERS. Provides RELEASE semantics like a regular unlock, the
1278  自旋锁解锁
1280  wake_up_q( & wake_q)
调用者
名称描述
mutex_unlockmutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.