函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

返回类型:int

参数:

类型参数名称
struct sem_array *sma
intsemnum
struct wake_q_head *wake_q
934  semop_completed等于0
936  如果semnum恒等于负1则pending_list等于pending operations
938  否则pending_list等于pending single-sop operations
941  again :
952  如果semnum不等于负1且current value 恒等于0则退出
955  error等于perform_atomic_semop(sma, q)
958  如果error大于0则继续下一循环
961  unlink_queue(sma, q)
963  如果error
964  restart等于0
965  否则
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  如果restart则转到:again
975  返回:semop_completed
调用者
名称描述
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