函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ask_work_add - ask the @task to execute @work->func()*@task: the task which should run the callback*@work: the callback to run*@notify: send the notification if true* Queue @work for task_work_run() below and notify the @task if @notify.

函数原型:int task_work_add(struct task_struct *task, struct callback_head *work, bool notify)

返回类型:int

参数:

类型参数名称
struct task_struct *task
struct callback_head *work
boolnotify
32  循环
33  head等于READ_ONCE(回调队列)
34  如果此条件成立可能性小(为编译器优化)(head == & all we need is ->next == NULL )则返回:负ESRCH
36  next等于head
37 cmpxchg( & 回调队列, head, work)不等于head循环
39  如果notifyset_notify_resume - cause tracehook_notify_resume() to be called*@task: task that will call tracehook_notify_resume()* Calling this arranges that @task will call tracehook_notify_resume()* before returning to user mode
41  返回:0
调用者
名称描述
irq_threadInterrupt handler thread
uprobe_copy_process复制上下文
report_accessdefers execution because cmdline access can sleep
mntput_no_expire
__rdtgroup_move_task
keyctl_session_to_parentAttempt to install the calling process's session keyring on the process's* parent process.* The keyring must exist and must grant the caller LINK permission, and the* parent process must be single-threaded and must have the same effective
fput_many