Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\sem.c Create Date:2022-07-28 16:45:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:add semadj values to semaphores, free undo structures

Proto:void exit_sem(struct task_struct *tsk)

Type:void

Parameter:

TypeParameterName
struct task_struct *tsk
2302  ulp = undo_list
2303  If Not ulp Then Return
2305  undo_list = NULL
2307  If Not _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 Then Return
2310  cycle
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(next, structsem_undo, list_proc)
2328  spin_lock( & lock)
2329  spin_unlock( & lock)
2331  Break
2333  spin_lock( & lock)
2334  semid = semaphore set identifier
2335  spin_unlock( & lock)
2338  If semid == -1 Then
2340  Continue
2343  sma = sem_obtain_object_check(ipc_ns, semid)
2345  If IS_ERR(sma) Then
2347  Continue
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  Continue
2357  un = __lookup_undo(ulp, semid)
2358  If (un == NULL) Then
2362  sem_unlock(sma, - 1)
2364  Continue
2368  ipc_assert_locked_object( & permissions .. see ipc.h )
2369  deletes entry from list
2371  spin_lock( & lock)
2372  list_del_rcu - deletes entry from list without re-initialization*@entry: the element to delete from the list
2373  spin_unlock( & lock)
2377  semaphore = sems[i]
2378  If array of adjustments [i] Then
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  kfree(ulp)
Caller
NameDescribe
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