Loading include/linux/sched.h +5 −0 Original line number Diff line number Diff line Loading @@ -2133,6 +2133,11 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) #endif /* CONFIG_SMP */ static inline bool task_is_runnable(struct task_struct *p) { return p->on_rq && !p->se.sched_delayed; } extern bool sched_task_on_rq(struct task_struct *p); extern unsigned long get_wchan(struct task_struct *p); extern struct task_struct *cpu_curr_snapshot(int cpu); Loading include/linux/task_work.h +4 −1 Original line number Diff line number Diff line Loading @@ -14,11 +14,14 @@ init_task_work(struct callback_head *twork, task_work_func_t func) } enum task_work_notify_mode { TWA_NONE, TWA_NONE = 0, TWA_RESUME, TWA_SIGNAL, TWA_SIGNAL_NO_IPI, TWA_NMI_CURRENT, TWA_FLAGS = 0xff00, TWAF_NO_ALLOC = 0x0100, }; static inline bool task_work_pending(struct task_struct *task) Loading kernel/events/core.c +1 −1 Original line number Diff line number Diff line Loading @@ -9251,7 +9251,7 @@ static void perf_event_switch(struct task_struct *task, }, }; if (!sched_in && task->on_rq) { if (!sched_in && task_is_runnable(task)) { switch_event.event_id.header.misc |= PERF_RECORD_MISC_SWITCH_OUT_PREEMPT; } Loading kernel/freezer.c +6 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,12 @@ static int __set_task_frozen(struct task_struct *p, void *arg) { unsigned int state = READ_ONCE(p->__state); if (p->on_rq) /* * Allow freezing the sched_delayed tasks; they will not execute until * ttwu() fixes them up, so it is safe to swap their state now, instead * of waiting for them to get fully dequeued. */ if (task_is_runnable(p)) return 0; if (p != current && task_curr(p)) Loading kernel/rcu/tasks.h +9 −0 Original line number Diff line number Diff line Loading @@ -985,6 +985,15 @@ static bool rcu_tasks_is_holdout(struct task_struct *t) if (!READ_ONCE(t->on_rq)) return false; /* * t->on_rq && !t->se.sched_delayed *could* be considered sleeping but * since it is a spurious state (it will transition into the * traditional blocked state or get woken up without outside * dependencies), not considering it such should only affect timing. * * Be conservative for now and not include it. */ /* * Idle tasks (or idle injection) within the idle loop are RCU-tasks * quiescent states. But CPU boot code performed by the idle task Loading Loading
include/linux/sched.h +5 −0 Original line number Diff line number Diff line Loading @@ -2133,6 +2133,11 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) #endif /* CONFIG_SMP */ static inline bool task_is_runnable(struct task_struct *p) { return p->on_rq && !p->se.sched_delayed; } extern bool sched_task_on_rq(struct task_struct *p); extern unsigned long get_wchan(struct task_struct *p); extern struct task_struct *cpu_curr_snapshot(int cpu); Loading
include/linux/task_work.h +4 −1 Original line number Diff line number Diff line Loading @@ -14,11 +14,14 @@ init_task_work(struct callback_head *twork, task_work_func_t func) } enum task_work_notify_mode { TWA_NONE, TWA_NONE = 0, TWA_RESUME, TWA_SIGNAL, TWA_SIGNAL_NO_IPI, TWA_NMI_CURRENT, TWA_FLAGS = 0xff00, TWAF_NO_ALLOC = 0x0100, }; static inline bool task_work_pending(struct task_struct *task) Loading
kernel/events/core.c +1 −1 Original line number Diff line number Diff line Loading @@ -9251,7 +9251,7 @@ static void perf_event_switch(struct task_struct *task, }, }; if (!sched_in && task->on_rq) { if (!sched_in && task_is_runnable(task)) { switch_event.event_id.header.misc |= PERF_RECORD_MISC_SWITCH_OUT_PREEMPT; } Loading
kernel/freezer.c +6 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,12 @@ static int __set_task_frozen(struct task_struct *p, void *arg) { unsigned int state = READ_ONCE(p->__state); if (p->on_rq) /* * Allow freezing the sched_delayed tasks; they will not execute until * ttwu() fixes them up, so it is safe to swap their state now, instead * of waiting for them to get fully dequeued. */ if (task_is_runnable(p)) return 0; if (p != current && task_curr(p)) Loading
kernel/rcu/tasks.h +9 −0 Original line number Diff line number Diff line Loading @@ -985,6 +985,15 @@ static bool rcu_tasks_is_holdout(struct task_struct *t) if (!READ_ONCE(t->on_rq)) return false; /* * t->on_rq && !t->se.sched_delayed *could* be considered sleeping but * since it is a spurious state (it will transition into the * traditional blocked state or get woken up without outside * dependencies), not considering it such should only affect timing. * * Be conservative for now and not include it. */ /* * Idle tasks (or idle injection) within the idle loop are RCU-tasks * quiescent states. But CPU boot code performed by the idle task Loading