函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-27 10:36:19
Last Modify:2022-05-22 13:40:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ry_to_wake_up - wake up a thread*@p: the thread to be awakened*@state: the mask of task states that can be woken*@wake_flags: wake modifier flags (WF_*)* If (@state & @p->state) @p->state = TASK_RUNNING.

函数原型:static int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)

返回类型:int

参数:

类型参数名称
struct task_struct *p
unsigned intstate
intwake_flags
2521  success等于0
2523  禁止抢占()
2524  如果p恒等于当前进程
2536  如果非任务状态按位与state的值则转到:out
2539  success等于1
2540  cpu等于task_cpu(p)
2541  Tracepoint called when waking a task; this tracepoint is guaranteed to be* called from the waking context.
2542  任务状态等于就绪态
2543  Tracepoint called when the task is actually woken; p->state == TASK_RUNNNG.* It it not always called from the waking context.
2544  转到:out
2553  raw_spin_lock_irqsave( & Protection of the PI data structures: , flags)
2554  smp_mb__after_spinlock() provides the equivalent of a full memory barrier* between program-order earlier lock acquisitions and program-order later* memory accesses()
2555  如果非任务状态按位与state的值则转到:unlock
2558  Tracepoint called when waking a task; this tracepoint is guaranteed to be* called from the waking context.
2561  success等于1
2562  cpu等于task_cpu(p)
2584  smp_rmb()
2585  如果归属队列Called in case the task @p isn't fully descheduled from its runqueue,* in this case we must do a remote wakeup. Its a 'light' wakeup though,* since all we need to do is flip p->state to TASK_RUNNING, since* the task is still ->on_rq.则转到:unlock
2638  如果in_iowait
2639  delayacct_blkio_end(p)
2640  atomic_dec( & nr_iowait)
2645  ttwu_queue(p, cpu, wake_flags)
2646  unlock :
2647  raw_spin_unlock_irqrestore( & Protection of the PI data structures: , flags)
2648  out :
2649  如果successttwu_stat(p, cpu, wake_flags)
2651  禁用抢占和中断()
2653  返回:success
调用者
名称描述
wake_up_process唤醒中断线程
wake_up_state
default_wake_function