Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pdate_queue - look for tasks that can be completed.*@sma: semaphore array.*@semnum: semaphore that was modified.*@wake_q: lockless wake-queue head.* update_queue must be called after a semaphore in a semaphore array* was modified

Proto:static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

Type:int

Parameter:

TypeParameterName
struct sem_array *sma
intsemnum
struct wake_q_head *wake_q
934  semop_completed = 0
936  If semnum == -1 Then pending_list = pending operations
938  Else pending_list = pending single-sop operations
941  again :
952  If semnum != -1 && current value == 0 Then Break
955  error = perform_atomic_semop(sma, q)
958  If error > 0 Then Continue
961  unlink_queue(sma, q)
963  If error Then
964  restart = 0
965  Else
966  semop_completed = 1
967  do_smart_wakeup_zero - wakeup all wait for zero tasks*@sma: semaphore array*@sops: operations that were performed*@nsops: number of operations*@wake_q: lockless wake-queue head* Checks all required queue for wait-for-zero operations, based
968  restart = heck_restart(sma, q)*@sma: semaphore array*@q: the operation that just completed* update_queue is O(N^2) when it restarts scanning the whole queue of* waiting operations. Therefore this function checks if the restart is* really necessary
971  wake_up_sem_queue_prepare(q, error, wake_q)
972  If restart Then Go to again
975  Return semop_completed
Caller
NameDescribe
do_smart_updatedo_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