From 84915fd80a3d2966fa84e0d1d0aa720d355f6d5b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 1 Apr 2022 16:58:07 +0200 Subject: [PATCH] ANDROID: add kernel/sched/android.h Create a place for the android-specific scheduler addons to live so that merges can happen easier and we have a better view of the technical debt that is being drug along with the kernel updates. Start it off with replacing an empty copy of task_may_not_preempt() to solve the build problem for some devices where they are relying on this function to be present in the system. Fixes: 65c99af98ba6 ("Revert "ANDROID: sched: avoid placing RT threads on cores handling softirqs"") Cc: Quentin Perret Cc: Will McVicker Signed-off-by: Greg Kroah-Hartman Change-Id: I4fd94fab3397b3a197b79b2ae27e9490b54cad59 --- kernel/sched/android.h | 17 +++++++++++++++++ kernel/sched/sched.h | 1 + 2 files changed, 18 insertions(+) create mode 100644 kernel/sched/android.h diff --git a/kernel/sched/android.h b/kernel/sched/android.h new file mode 100644 index 000000000000..2acd84cd742b --- /dev/null +++ b/kernel/sched/android.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Android scheduler hooks and modifications + * + * Put all of the android-specific scheduler hooks and changes + * in this .h file to make merges and modifications easier. It's also + * simpler to notice what is, and is not, an upstream change this way over time. + */ + + +/* + * task_may_not_preempt - check whether a task may not be preemptible soon + */ +static inline bool task_may_not_preempt(struct task_struct *task, int cpu) +{ + return false; +} diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index a9e960ca4ec0..5e67c6900bda 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -67,6 +67,7 @@ #include #include #include +#include "android.h" #include