aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorElliot Berman <quic_eberman@quicinc.com>2023-09-08 15:49:15 -0700
committerIngo Molnar <mingo@kernel.org>2023-09-18 08:13:57 +0200
commitfbaa6a181a4b1886cbf4214abdf9a2df68471510 (patch)
treececed1ad476ddaa0aa756e3ef8bc36f9a62942d4 /kernel/sched
parent4ff34ad3d39377d9f6953f3606ccf611ce636767 (diff)
downloadlinux-fbaa6a181a4b1886cbf4214abdf9a2df68471510.tar.gz
sched/core: Remove ifdeffery for saved_state
In preparation for freezer to also use saved_state, remove the CONFIG_PREEMPT_RT compilation guard around saved_state. On the arm64 platform I tested which did not have CONFIG_PREEMPT_RT, there was no statistically significant deviation by applying this patch. Test methodology: perf bench sched message -g 40 -l 40 Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f39482d6a6e69b..49541e3c1295ee 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2232,23 +2232,20 @@ int __task_state_match(struct task_struct *p, unsigned int state)
if (READ_ONCE(p->__state) & state)
return 1;
-#ifdef CONFIG_PREEMPT_RT
if (READ_ONCE(p->saved_state) & state)
return -1;
-#endif
+
return 0;
}
static __always_inline
int task_state_match(struct task_struct *p, unsigned int state)
{
-#ifdef CONFIG_PREEMPT_RT
/*
* Serialize against current_save_and_set_rtlock_wait_state() and
* current_restore_rtlock_saved_state().
*/
guard(raw_spinlock_irq)(&p->pi_lock);
-#endif
return __task_state_match(p, state);
}
@@ -4038,7 +4035,6 @@ bool ttwu_state_match(struct task_struct *p, unsigned int state, int *success)
*success = !!(match = __task_state_match(p, state));
-#ifdef CONFIG_PREEMPT_RT
/*
* Saved state preserves the task state across blocking on
* an RT lock. If the state matches, set p::saved_state to
@@ -4054,7 +4050,7 @@ bool ttwu_state_match(struct task_struct *p, unsigned int state, int *success)
*/
if (match < 0)
p->saved_state = TASK_RUNNING;
-#endif
+
return match > 0;
}