Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\mutex.c Create Date:2022-07-28 09:47:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__mutex_unlock_slowpath

Proto:static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigned long ip)

Type:void

Parameter:

TypeParameterName
struct mutex *lock
unsigned longip
1224  struct task_struct * next = NULL
1228  mutex_release( & dep_map, ip)
1237  owner = atomic_long_read( & owner)
1238  cycle
1246  If owner & MUTEX_FLAG_HANDOFF Then Break
1249  old = atomic_long_cmpxchg_release( & owner, owner, __owner_flags(owner))
1251  If old == owner Then
1255  Return
1258  owner = old
1261  spin_lock( & wait_lock)
1262  debug_mutex_unlock(lock)
1263  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
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  If owner & MUTEX_FLAG_HANDOFF Then Give 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  spin_unlock( & wait_lock)
1280  wake_up_q( & wake_q)
Caller
NameDescribe
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.