Add a config option to enable schedule time slice extension.
Signed-off-by: Prakash Sangappa <prakash.sangappa@xxxxxxxxxx>
---
include/linux/entry-common.h | 2 +-
include/linux/sched.h | 8 ++++----
init/Kconfig | 7 +++++++
kernel/rseq.c | 5 ++++-
kernel/sched/core.c | 12 ++++++------
kernel/sched/debug.c | 2 +-
kernel/sched/syscalls.c | 3 ++-
7 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index d4fa952e394e..351c9dc159bc 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -402,7 +402,7 @@ static __always_inline void syscall_exit_to_user_mode_work(struct pt_regs *regs)
CT_WARN_ON(ct_state() != CT_STATE_KERNEL);
/* reschedule if sched delay was granted */
- if (IS_ENABLED(CONFIG_RSEQ) && current->sched_time_delay)
+ if (IS_ENABLED(CONFIG_SCHED_PREEMPT_DELAY) && current->sched_time_delay)
set_tsk_need_resched(current);
if (IS_ENABLED(CONFIG_PROVE_LOCKING)) {
diff --git a/init/Kconfig b/init/Kconfig
index ce76e913aa2b..2f5f603d175a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1130,6 +1130,13 @@ config SCHED_MM_CID
def_bool y
depends on SMP && RSEQ
+config SCHED_PREEMPT_DELAY
+ def_bool y
+ depends on SMP && RSEQ
+ help
+ This feature enables a thread to request extending its time slice on
+ the cpu by delaying preemption.
+
config UCLAMP_TASK_GROUP
bool "Utilization clamping per group of tasks"
depends on CGROUP_SCHED