Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-28 09:35:43
Last Modify:2022-05-22 13:40:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)

Type:int

Parameter:

TypeParameterName
struct task_struct *p
unsigned intstate
intwake_flags
2521  success = 0
2523  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
2524  If p == current process Then
2536  If Not (run state & state) Then Go to 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  run state = Used in tsk->state:
2543  Tracepoint called when the task is actually woken; p->state == TASK_RUNNNG.* It it not always called from the waking context.
2544  Go to 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  If Not (run state & state) Then Go to 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  If on_rq && 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. Then Go to unlock
2638  If in_iowait Then
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  If success Then ttwu_stat(p, cpu, wake_flags)
2651  preempt_enable()
2653  Return success
Caller
NameDescribe
wake_up_processwake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
wake_up_state
default_wake_function