函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Free a semaphore set. freeary() is called with sem_ids.rwsem locked* as a writer and the spinlock for this semaphore set hold. sem_ids.rwsem* remains locked on exit.

函数原型:static void freeary(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)

返回类型:void

参数:

类型参数名称
struct ipc_namespace *ns
struct kern_ipc_perm *ipcp
1128  sma等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(ipcp, structsem_array, sem_perm)
1133  ipc_assert_locked_object( & permissions .. see ipc.h )
1135  删除链表项
1136  加自旋锁
1137  semaphore set identifier 等于负1
1138  删除不需要重新初始化的列表项
1139  自旋锁解锁
1140  kfree_rcu() - kfree an object after a grace period(un, rcu)
1145  unlink_queue(sma, q)
1146  wake_up_sem_queue_prepare(q, - EIDRM, & wake_q)
1150  unlink_queue(sma, q)
1151  wake_up_sem_queue_prepare(q, - EIDRM, & wake_q)
1153 i小于. of semaphores in array 循环
1154  sem等于sems[i]
1156  unlink_queue(sma, q)
1157  wake_up_sem_queue_prepare(q, - EIDRM, & wake_q)
1160  unlink_queue(sma, q)
1161  wake_up_sem_queue_prepare(q, - EIDRM, & wake_q)
1163  ipc_update_pid( & PID of the process that last modified the semaphore. For* Linux, specifically these are:* - semop* - semctl, via SETVAL and SETALL.* - at task exit when performing undo adjustments (see exit_sem)., NULL)
1167  sem_rmid(ns, sma)
1168  sem_unlock(sma, - 1)
1169  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1171  wake_up_q( & wake_q)
1172  used_sems减等于. of semaphores in array
1173  ipc_rcu_putref( & permissions .. see ipc.h , sem_rcu_free)
调用者
名称描述
semctl_downThis function handles some semctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.