函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:add semadj values to semaphores, free undo structures

函数原型:void exit_sem(struct task_struct *tsk)

返回类型:void

参数:

类型参数名称
struct task_struct *tsk
2302  ulp等于undo_list
2303  如果非ulp则返回
2305  undo_list = NULL
2307  如果非_dec_and_test - decrement a refcount and test if it is 0*@r: the refcount* Similar to atomic_dec_and_test(), it will WARN on underflow and fail to* decrement when saturated at REFCOUNT_SATURATED则返回
2310  循环
2316  cond_resched()
2318  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
2319  un等于list_entry_rcu - get the struct for this entry*@ptr: the &struct list_head pointer(链表后项, structsem_undo, list_proc)
2328  加自旋锁
2331  退出
2333  加自旋锁
2334  semid等于semaphore set identifier
2335  自旋锁解锁
2338  如果semid恒等于负1则
2340  继续下一循环
2343  sma等于sem_obtain_object_check(ipc_ns, semid)
2345  如果是错误
2347  继续下一循环
2350  If the request contains only one semaphore operation, and there are* no complex transactions pending, lock only the semaphore involved
2353  sem_unlock(sma, - 1)
2355  继续下一循环
2357  un等于__lookup_undo(ulp, semid)
2358  如果(un == NULL)则
2362  sem_unlock(sma, - 1)
2364  继续下一循环
2368  ipc_assert_locked_object( & permissions .. see ipc.h )
2369  删除链表项
2371  加自旋锁
2372  删除不需要重新初始化的列表项
2373  自旋锁解锁
2377  semaphore等于sems[i]
2378  如果array of adjustments [i]则
2401  do_smart_update - optimized update_queue*@sma: semaphore array*@sops: operations that were performed*@nsops: number of operations*@otime: force setting otime*@wake_q: lockless wake-queue head* do_smart_update() does the required calls to update_queue and
2402  sem_unlock(sma, - 1)
2403  _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()
2404  wake_up_q( & wake_q)
2406  kfree_rcu() - kfree an object after a grace period(un, rcu)
2408  释放内存
调用者
名称描述
ksys_unshareshare allows a process to 'unshare' part of the process* context which was originally shared using clone. copy_** functions used by do_fork() cannot be used here directly* because they modify an inactive task_struct that is being* constructed
do_exit
ipcns_install
copy_process创建进程