|
|
@@ -5,7 +5,7 @@ index 42af9ca0127e..31747ec54f9d 100644
|
|
|
|
@@ -5406,6 +5406,12 @@
|
|
|
|
@@ -5406,6 +5406,12 @@
|
|
|
|
sa1100ir [NET]
|
|
|
|
sa1100ir [NET]
|
|
|
|
See drivers/net/irda/sa1100_ir.c.
|
|
|
|
See drivers/net/irda/sa1100_ir.c.
|
|
|
|
|
|
|
|
|
|
|
|
+ sched_timeslice=
|
|
|
|
+ sched_timeslice=
|
|
|
|
+ [KNL] Time slice in ms for Project C BMQ/PDS scheduler.
|
|
|
|
+ [KNL] Time slice in ms for Project C BMQ/PDS scheduler.
|
|
|
|
+ Format: integer 2, 4
|
|
|
|
+ Format: integer 2, 4
|
|
|
@@ -13,14 +13,14 @@ index 42af9ca0127e..31747ec54f9d 100644
|
|
|
|
+ See Documentation/scheduler/sched-BMQ.txt
|
|
|
|
+ See Documentation/scheduler/sched-BMQ.txt
|
|
|
|
+
|
|
|
|
+
|
|
|
|
sched_verbose [KNL] Enables verbose scheduler debug messages.
|
|
|
|
sched_verbose [KNL] Enables verbose scheduler debug messages.
|
|
|
|
|
|
|
|
|
|
|
|
schedstats= [KNL,X86] Enable or disable scheduled statistics.
|
|
|
|
schedstats= [KNL,X86] Enable or disable scheduled statistics.
|
|
|
|
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
index 98d1b198b2b4..d7c78a107f93 100644
|
|
|
|
index 98d1b198b2b4..d7c78a107f93 100644
|
|
|
|
--- a/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
--- a/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
+++ b/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
+++ b/Documentation/admin-guide/sysctl/kernel.rst
|
|
|
|
@@ -1552,3 +1552,13 @@ is 10 seconds.
|
|
|
|
@@ -1552,3 +1552,13 @@ is 10 seconds.
|
|
|
|
|
|
|
|
|
|
|
|
The softlockup threshold is (``2 * watchdog_thresh``). Setting this
|
|
|
|
The softlockup threshold is (``2 * watchdog_thresh``). Setting this
|
|
|
|
tunable to zero will disable lockup detection altogether.
|
|
|
|
tunable to zero will disable lockup detection altogether.
|
|
|
|
+
|
|
|
|
+
|
|
|
@@ -161,7 +161,7 @@ index 9e479d7d202b..2a8530021b23 100644
|
|
|
|
+ (unsigned long long)tsk_seruntime(task),
|
|
|
|
+ (unsigned long long)tsk_seruntime(task),
|
|
|
|
(unsigned long long)task->sched_info.run_delay,
|
|
|
|
(unsigned long long)task->sched_info.run_delay,
|
|
|
|
task->sched_info.pcount);
|
|
|
|
task->sched_info.pcount);
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h
|
|
|
|
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h
|
|
|
|
index 8874f681b056..59eb72bf7d5f 100644
|
|
|
|
index 8874f681b056..59eb72bf7d5f 100644
|
|
|
|
--- a/include/asm-generic/resource.h
|
|
|
|
--- a/include/asm-generic/resource.h
|
|
|
@@ -181,7 +181,7 @@ index ffb6eb55cd13..2e730a59caa2 100644
|
|
|
|
+++ b/include/linux/sched.h
|
|
|
|
+++ b/include/linux/sched.h
|
|
|
|
@@ -762,8 +762,14 @@ struct task_struct {
|
|
|
|
@@ -762,8 +762,14 @@ struct task_struct {
|
|
|
|
unsigned int ptrace;
|
|
|
|
unsigned int ptrace;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
- int on_cpu;
|
|
|
|
- int on_cpu;
|
|
|
|
struct __call_single_node wake_entry;
|
|
|
|
struct __call_single_node wake_entry;
|
|
|
@@ -202,11 +202,11 @@ index ffb6eb55cd13..2e730a59caa2 100644
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
int on_rq;
|
|
|
|
int on_rq;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -785,6 +792,20 @@ struct task_struct {
|
|
|
|
@@ -785,6 +792,20 @@ struct task_struct {
|
|
|
|
int normal_prio;
|
|
|
|
int normal_prio;
|
|
|
|
unsigned int rt_priority;
|
|
|
|
unsigned int rt_priority;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+ u64 last_ran;
|
|
|
|
+ u64 last_ran;
|
|
|
|
+ s64 time_slice;
|
|
|
|
+ s64 time_slice;
|
|
|
@@ -229,13 +229,13 @@ index ffb6eb55cd13..2e730a59caa2 100644
|
|
|
|
unsigned int core_occupation;
|
|
|
|
unsigned int core_occupation;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_CGROUP_SCHED
|
|
|
|
#ifdef CONFIG_CGROUP_SCHED
|
|
|
|
struct task_group *sched_task_group;
|
|
|
|
struct task_group *sched_task_group;
|
|
|
|
@@ -1545,6 +1567,15 @@ struct task_struct {
|
|
|
|
@@ -1545,6 +1567,15 @@ struct task_struct {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#define tsk_seruntime(t) ((t)->sched_time)
|
|
|
|
+#define tsk_seruntime(t) ((t)->sched_time)
|
|
|
|
+/* replace the uncertian rt_timeout with 0UL */
|
|
|
|
+/* replace the uncertian rt_timeout with 0UL */
|
|
|
@@ -254,7 +254,7 @@ index 7c83d4d5a971..fa30f98cb2be 100644
|
|
|
|
+++ b/include/linux/sched/deadline.h
|
|
|
|
+++ b/include/linux/sched/deadline.h
|
|
|
|
@@ -1,5 +1,24 @@
|
|
|
|
@@ -1,5 +1,24 @@
|
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static inline int dl_task(struct task_struct *p)
|
|
|
|
+static inline int dl_task(struct task_struct *p)
|
|
|
@@ -282,7 +282,7 @@ index 7c83d4d5a971..fa30f98cb2be 100644
|
|
|
|
return dl_prio(p->prio);
|
|
|
|
return dl_prio(p->prio);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool dl_time_before(u64 a, u64 b)
|
|
|
|
static inline bool dl_time_before(u64 a, u64 b)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h
|
|
|
|
diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h
|
|
|
@@ -292,7 +292,7 @@ index ab83d85e1183..6af9ae681116 100644
|
|
|
|
@@ -18,6 +18,32 @@
|
|
|
|
@@ -18,6 +18,32 @@
|
|
|
|
#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)
|
|
|
|
#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)
|
|
|
|
#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)
|
|
|
|
#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/* Undefine MAX_PRIO and DEFAULT_PRIO */
|
|
|
|
+/* Undefine MAX_PRIO and DEFAULT_PRIO */
|
|
|
@@ -327,7 +327,7 @@ index 994c25640e15..8c050a59ece1 100644
|
|
|
|
--- a/include/linux/sched/rt.h
|
|
|
|
--- a/include/linux/sched/rt.h
|
|
|
|
+++ b/include/linux/sched/rt.h
|
|
|
|
+++ b/include/linux/sched/rt.h
|
|
|
|
@@ -24,8 +24,10 @@ static inline bool task_is_realtime(struct task_struct *tsk)
|
|
|
|
@@ -24,8 +24,10 @@ static inline bool task_is_realtime(struct task_struct *tsk)
|
|
|
|
|
|
|
|
|
|
|
|
if (policy == SCHED_FIFO || policy == SCHED_RR)
|
|
|
|
if (policy == SCHED_FIFO || policy == SCHED_RR)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
@@ -336,15 +336,15 @@ index 994c25640e15..8c050a59ece1 100644
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
|
|
|
|
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
|
|
|
|
index 816df6cc444e..c8da08e18c91 100644
|
|
|
|
index 816df6cc444e..c8da08e18c91 100644
|
|
|
|
--- a/include/linux/sched/topology.h
|
|
|
|
--- a/include/linux/sched/topology.h
|
|
|
|
+++ b/include/linux/sched/topology.h
|
|
|
|
+++ b/include/linux/sched/topology.h
|
|
|
|
@@ -234,7 +234,8 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
|
|
|
|
@@ -234,7 +234,8 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* !CONFIG_SMP */
|
|
|
|
#endif /* !CONFIG_SMP */
|
|
|
|
|
|
|
|
|
|
|
|
-#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
|
|
|
|
-#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
|
|
|
|
+#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) && \
|
|
|
|
+#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) && \
|
|
|
|
+ !defined(CONFIG_SCHED_ALT)
|
|
|
|
+ !defined(CONFIG_SCHED_ALT)
|
|
|
@@ -364,9 +364,9 @@ index 94125d3b6893..c87ba766d354 100644
|
|
|
|
This feature enables the scheduler to track the clamped utilization
|
|
|
|
This feature enables the scheduler to track the clamped utilization
|
|
|
|
of each CPU based on RUNNABLE tasks scheduled on that CPU.
|
|
|
|
of each CPU based on RUNNABLE tasks scheduled on that CPU.
|
|
|
|
@@ -865,6 +866,35 @@ config UCLAMP_BUCKETS_COUNT
|
|
|
|
@@ -865,6 +866,35 @@ config UCLAMP_BUCKETS_COUNT
|
|
|
|
|
|
|
|
|
|
|
|
If in doubt, use the default value.
|
|
|
|
If in doubt, use the default value.
|
|
|
|
|
|
|
|
|
|
|
|
+menuconfig SCHED_ALT
|
|
|
|
+menuconfig SCHED_ALT
|
|
|
|
+ bool "Alternative CPU Schedulers"
|
|
|
|
+ bool "Alternative CPU Schedulers"
|
|
|
|
+ default y
|
|
|
|
+ default y
|
|
|
@@ -397,7 +397,7 @@ index 94125d3b6893..c87ba766d354 100644
|
|
|
|
+endif
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
endmenu
|
|
|
|
endmenu
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
#
|
|
|
|
@@ -918,6 +948,7 @@ config NUMA_BALANCING
|
|
|
|
@@ -918,6 +948,7 @@ config NUMA_BALANCING
|
|
|
|
depends on ARCH_SUPPORTS_NUMA_BALANCING
|
|
|
|
depends on ARCH_SUPPORTS_NUMA_BALANCING
|
|
|
@@ -410,7 +410,7 @@ index 94125d3b6893..c87ba766d354 100644
|
|
|
|
@@ -1015,6 +1046,7 @@ config FAIR_GROUP_SCHED
|
|
|
|
@@ -1015,6 +1046,7 @@ config FAIR_GROUP_SCHED
|
|
|
|
depends on CGROUP_SCHED
|
|
|
|
depends on CGROUP_SCHED
|
|
|
|
default CGROUP_SCHED
|
|
|
|
default CGROUP_SCHED
|
|
|
|
|
|
|
|
|
|
|
|
+if !SCHED_ALT
|
|
|
|
+if !SCHED_ALT
|
|
|
|
config CFS_BANDWIDTH
|
|
|
|
config CFS_BANDWIDTH
|
|
|
|
bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
|
|
|
|
bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
|
|
|
@@ -418,13 +418,13 @@ index 94125d3b6893..c87ba766d354 100644
|
|
|
|
@@ -1037,6 +1069,7 @@ config RT_GROUP_SCHED
|
|
|
|
@@ -1037,6 +1069,7 @@ config RT_GROUP_SCHED
|
|
|
|
realtime bandwidth for them.
|
|
|
|
realtime bandwidth for them.
|
|
|
|
See Documentation/scheduler/sched-rt-group.rst for more information.
|
|
|
|
See Documentation/scheduler/sched-rt-group.rst for more information.
|
|
|
|
|
|
|
|
|
|
|
|
+endif #!SCHED_ALT
|
|
|
|
+endif #!SCHED_ALT
|
|
|
|
endif #CGROUP_SCHED
|
|
|
|
endif #CGROUP_SCHED
|
|
|
|
|
|
|
|
|
|
|
|
config UCLAMP_TASK_GROUP
|
|
|
|
config UCLAMP_TASK_GROUP
|
|
|
|
@@ -1281,6 +1314,7 @@ config CHECKPOINT_RESTORE
|
|
|
|
@@ -1281,6 +1314,7 @@ config CHECKPOINT_RESTORE
|
|
|
|
|
|
|
|
|
|
|
|
config SCHED_AUTOGROUP
|
|
|
|
config SCHED_AUTOGROUP
|
|
|
|
bool "Automatic process group scheduling"
|
|
|
|
bool "Automatic process group scheduling"
|
|
|
|
+ depends on !SCHED_ALT
|
|
|
|
+ depends on !SCHED_ALT
|
|
|
@@ -482,7 +482,7 @@ index c2f1fd95a821..41654679b1b2 100644
|
|
|
|
--- a/kernel/Kconfig.preempt
|
|
|
|
--- a/kernel/Kconfig.preempt
|
|
|
|
+++ b/kernel/Kconfig.preempt
|
|
|
|
+++ b/kernel/Kconfig.preempt
|
|
|
|
@@ -117,7 +117,7 @@ config PREEMPT_DYNAMIC
|
|
|
|
@@ -117,7 +117,7 @@ config PREEMPT_DYNAMIC
|
|
|
|
|
|
|
|
|
|
|
|
config SCHED_CORE
|
|
|
|
config SCHED_CORE
|
|
|
|
bool "Core Scheduling for SMT"
|
|
|
|
bool "Core Scheduling for SMT"
|
|
|
|
- depends on SCHED_SMT
|
|
|
|
- depends on SCHED_SMT
|
|
|
@@ -497,7 +497,7 @@ index b474289c15b8..a23224b45b03 100644
|
|
|
|
@@ -787,7 +787,7 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
|
|
|
|
@@ -787,7 +787,7 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_SMP
|
|
|
|
-#ifdef CONFIG_SMP
|
|
|
|
+#if defined(CONFIG_SMP) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
+#if defined(CONFIG_SMP) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@@ -522,9 +522,9 @@ index e39cb696cfbd..463423572e09 100644
|
|
|
|
t2 = tsk->sched_info.run_delay;
|
|
|
|
t2 = tsk->sched_info.run_delay;
|
|
|
|
- t3 = tsk->se.sum_exec_runtime;
|
|
|
|
- t3 = tsk->se.sum_exec_runtime;
|
|
|
|
+ t3 = tsk_seruntime(tsk);
|
|
|
|
+ t3 = tsk_seruntime(tsk);
|
|
|
|
|
|
|
|
|
|
|
|
d->cpu_count += t1;
|
|
|
|
d->cpu_count += t1;
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/kernel/exit.c b/kernel/exit.c
|
|
|
|
diff --git a/kernel/exit.c b/kernel/exit.c
|
|
|
|
index 35e0a31a0315..64e368441cf4 100644
|
|
|
|
index 35e0a31a0315..64e368441cf4 100644
|
|
|
|
--- a/kernel/exit.c
|
|
|
|
--- a/kernel/exit.c
|
|
|
@@ -532,11 +532,11 @@ index 35e0a31a0315..64e368441cf4 100644
|
|
|
|
@@ -125,7 +125,7 @@ static void __exit_signal(struct task_struct *tsk)
|
|
|
|
@@ -125,7 +125,7 @@ static void __exit_signal(struct task_struct *tsk)
|
|
|
|
sig->curr_target = next_thread(tsk);
|
|
|
|
sig->curr_target = next_thread(tsk);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
|
|
|
|
- add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
|
|
|
|
+ add_device_randomness((const void*) &tsk_seruntime(tsk),
|
|
|
|
+ add_device_randomness((const void*) &tsk_seruntime(tsk),
|
|
|
|
sizeof(unsigned long long));
|
|
|
|
sizeof(unsigned long long));
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
@@ -146,7 +146,7 @@ static void __exit_signal(struct task_struct *tsk)
|
|
|
|
@@ -146,7 +146,7 @@ static void __exit_signal(struct task_struct *tsk)
|
|
|
|
sig->inblock += task_io_get_inblock(tsk);
|
|
|
|
sig->inblock += task_io_get_inblock(tsk);
|
|
|
@@ -558,14 +558,14 @@ index 7779ee8abc2a..5b9893cdfb1b 100644
|
|
|
|
- waiter->deadline = task->dl.deadline;
|
|
|
|
- waiter->deadline = task->dl.deadline;
|
|
|
|
+ waiter->deadline = __tsk_deadline(task);
|
|
|
|
+ waiter->deadline = __tsk_deadline(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Only use with rt_mutex_waiter_{less,equal}()
|
|
|
|
* Only use with rt_mutex_waiter_{less,equal}()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define task_to_waiter(p) \
|
|
|
|
#define task_to_waiter(p) \
|
|
|
|
- &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = (p)->dl.deadline }
|
|
|
|
- &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = (p)->dl.deadline }
|
|
|
|
+ &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = __tsk_deadline(p) }
|
|
|
|
+ &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = __tsk_deadline(p) }
|
|
|
|
|
|
|
|
|
|
|
|
static __always_inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left,
|
|
|
|
static __always_inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left,
|
|
|
|
struct rt_mutex_waiter *right)
|
|
|
|
struct rt_mutex_waiter *right)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -574,7 +574,7 @@ index 7779ee8abc2a..5b9893cdfb1b 100644
|
|
|
|
+#else
|
|
|
|
+#else
|
|
|
|
if (left->prio < right->prio)
|
|
|
|
if (left->prio < right->prio)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_BMQ
|
|
|
|
+#ifndef CONFIG_SCHED_BMQ
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* If both waiters have dl_prio(), we check the deadlines of the
|
|
|
|
* If both waiters have dl_prio(), we check the deadlines of the
|
|
|
@@ -584,11 +584,11 @@ index 7779ee8abc2a..5b9893cdfb1b 100644
|
|
|
|
if (dl_prio(left->prio))
|
|
|
|
if (dl_prio(left->prio))
|
|
|
|
return dl_time_before(left->deadline, right->deadline);
|
|
|
|
return dl_time_before(left->deadline, right->deadline);
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static __always_inline int rt_mutex_waiter_equal(struct rt_mutex_waiter *left,
|
|
|
|
static __always_inline int rt_mutex_waiter_equal(struct rt_mutex_waiter *left,
|
|
|
|
struct rt_mutex_waiter *right)
|
|
|
|
struct rt_mutex_waiter *right)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -597,7 +597,7 @@ index 7779ee8abc2a..5b9893cdfb1b 100644
|
|
|
|
+#else
|
|
|
|
+#else
|
|
|
|
if (left->prio != right->prio)
|
|
|
|
if (left->prio != right->prio)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_BMQ
|
|
|
|
+#ifndef CONFIG_SCHED_BMQ
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* If both waiters have dl_prio(), we check the deadlines of the
|
|
|
|
* If both waiters have dl_prio(), we check the deadlines of the
|
|
|
@@ -607,11 +607,11 @@ index 7779ee8abc2a..5b9893cdfb1b 100644
|
|
|
|
if (dl_prio(left->prio))
|
|
|
|
if (dl_prio(left->prio))
|
|
|
|
return left->deadline == right->deadline;
|
|
|
|
return left->deadline == right->deadline;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool rt_mutex_steal(struct rt_mutex_waiter *waiter,
|
|
|
|
static inline bool rt_mutex_steal(struct rt_mutex_waiter *waiter,
|
|
|
|
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
|
|
|
|
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
|
|
|
|
index 976092b7bd45..31d587c16ec1 100644
|
|
|
|
index 976092b7bd45..31d587c16ec1 100644
|
|
|
@@ -632,10 +632,10 @@ index 976092b7bd45..31d587c16ec1 100644
|
|
|
|
obj-y += build_utility.o
|
|
|
|
obj-y += build_utility.o
|
|
|
|
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
|
|
|
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
|
|
|
new file mode 100644
|
|
|
|
new file mode 100644
|
|
|
|
index 000000000000..572eab74418f
|
|
|
|
index 000000000000..acb8657e811d
|
|
|
|
--- /dev/null
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/kernel/sched/alt_core.c
|
|
|
|
+++ b/kernel/sched/alt_core.c
|
|
|
|
@@ -0,0 +1,7961 @@
|
|
|
|
@@ -0,0 +1,7978 @@
|
|
|
|
+/*
|
|
|
|
+/*
|
|
|
|
+ * kernel/sched/alt_core.c
|
|
|
|
+ * kernel/sched/alt_core.c
|
|
|
|
+ *
|
|
|
|
+ *
|
|
|
@@ -665,7 +665,6 @@ index 000000000000..572eab74418f
|
|
|
|
+#include <linux/init_task.h>
|
|
|
|
+#include <linux/init_task.h>
|
|
|
|
+#include <linux/kcov.h>
|
|
|
|
+#include <linux/kcov.h>
|
|
|
|
+#include <linux/kprobes.h>
|
|
|
|
+#include <linux/kprobes.h>
|
|
|
|
+#include <linux/profile.h>
|
|
|
|
|
|
|
|
+#include <linux/nmi.h>
|
|
|
|
+#include <linux/nmi.h>
|
|
|
|
+#include <linux/scs.h>
|
|
|
|
+#include <linux/scs.h>
|
|
|
|
+
|
|
|
|
+
|
|
|
@@ -706,7 +705,7 @@ index 000000000000..572eab74418f
|
|
|
|
+#define sched_feat(x) (0)
|
|
|
|
+#define sched_feat(x) (0)
|
|
|
|
+#endif /* CONFIG_SCHED_DEBUG */
|
|
|
|
+#endif /* CONFIG_SCHED_DEBUG */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#define ALT_SCHED_VERSION "v6.1-r1"
|
|
|
|
+#define ALT_SCHED_VERSION "v6.1-r3"
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/* rt_prio(prio) defined in include/linux/sched/rt.h */
|
|
|
|
+/* rt_prio(prio) defined in include/linux/sched/rt.h */
|
|
|
|
+#define rt_task(p) rt_prio((p)->prio)
|
|
|
|
+#define rt_task(p) rt_prio((p)->prio)
|
|
|
@@ -815,14 +814,14 @@ index 000000000000..572eab74418f
|
|
|
|
+clear_recorded_preempt_mask(int pr, int low, int high, int cpu)
|
|
|
|
+clear_recorded_preempt_mask(int pr, int low, int high, int cpu)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ if (low < pr && pr <= high)
|
|
|
|
+ if (low < pr && pr <= high)
|
|
|
|
+ cpumask_clear_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - 1 - pr);
|
|
|
|
+ cpumask_clear_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - pr);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static inline void
|
|
|
|
+static inline void
|
|
|
|
+set_recorded_preempt_mask(int pr, int low, int high, int cpu)
|
|
|
|
+set_recorded_preempt_mask(int pr, int low, int high, int cpu)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ if (low < pr && pr <= high)
|
|
|
|
+ if (low < pr && pr <= high)
|
|
|
|
+ cpumask_set_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - 1 - pr);
|
|
|
|
+ cpumask_set_cpu(cpu, sched_preempt_mask + SCHED_QUEUE_BITS - pr);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static atomic_t sched_prio_record = ATOMIC_INIT(0);
|
|
|
|
+static atomic_t sched_prio_record = ATOMIC_INIT(0);
|
|
|
@@ -1392,8 +1391,8 @@ index 000000000000..572eab74418f
|
|
|
|
+ * Context: rq->lock
|
|
|
|
+ * Context: rq->lock
|
|
|
|
+ */
|
|
|
|
+ */
|
|
|
|
+#define __SCHED_DEQUEUE_TASK(p, rq, flags) \
|
|
|
|
+#define __SCHED_DEQUEUE_TASK(p, rq, flags) \
|
|
|
|
+ psi_dequeue(p, flags & DEQUEUE_SLEEP); \
|
|
|
|
|
|
|
|
+ sched_info_dequeue(rq, p); \
|
|
|
|
+ sched_info_dequeue(rq, p); \
|
|
|
|
|
|
|
|
+ psi_dequeue(p, flags & DEQUEUE_SLEEP); \
|
|
|
|
+ \
|
|
|
|
+ \
|
|
|
|
+ list_del(&p->sq_node); \
|
|
|
|
+ list_del(&p->sq_node); \
|
|
|
|
+ if (list_empty(&rq->queue.heads[p->sq_idx])) \
|
|
|
|
+ if (list_empty(&rq->queue.heads[p->sq_idx])) \
|
|
|
@@ -2030,11 +2029,13 @@ index 000000000000..572eab74418f
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ WARN_ON_ONCE(is_migration_disabled(p));
|
|
|
|
+ WARN_ON_ONCE(is_migration_disabled(p));
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
+ if (task_cpu(p) == new_cpu)
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
+ trace_sched_migrate_task(p, new_cpu);
|
|
|
|
+ trace_sched_migrate_task(p, new_cpu);
|
|
|
|
+ rseq_migrate(p);
|
|
|
|
+
|
|
|
|
+ perf_event_task_migrate(p);
|
|
|
|
+ if (task_cpu(p) != new_cpu)
|
|
|
|
|
|
|
|
+ {
|
|
|
|
|
|
|
|
+ rseq_migrate(p);
|
|
|
|
|
|
|
|
+ perf_event_task_migrate(p);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ __set_task_cpu(p, new_cpu);
|
|
|
|
+ __set_task_cpu(p, new_cpu);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
@@ -5110,15 +5111,15 @@ index 000000000000..572eab74418f
|
|
|
|
+ if (src_rq->nr_running < 2)
|
|
|
|
+ if (src_rq->nr_running < 2)
|
|
|
|
+ cpumask_clear_cpu(i, &sched_rq_pending_mask);
|
|
|
|
+ cpumask_clear_cpu(i, &sched_rq_pending_mask);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
+ spin_release(&src_rq->lock.dep_map, _RET_IP_);
|
|
|
|
|
|
|
|
+ do_raw_spin_unlock(&src_rq->lock);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ rq->nr_running += nr_migrated;
|
|
|
|
+ rq->nr_running += nr_migrated;
|
|
|
|
+ if (rq->nr_running > 1)
|
|
|
|
+ if (rq->nr_running > 1)
|
|
|
|
+ cpumask_set_cpu(cpu, &sched_rq_pending_mask);
|
|
|
|
+ cpumask_set_cpu(cpu, &sched_rq_pending_mask);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ cpufreq_update_util(rq, 0);
|
|
|
|
+ cpufreq_update_util(rq, 0);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ spin_release(&src_rq->lock.dep_map, _RET_IP_);
|
|
|
|
|
|
|
|
+ do_raw_spin_unlock(&src_rq->lock);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ return 1;
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
@@ -5147,7 +5148,7 @@ index 000000000000..572eab74418f
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static inline struct task_struct *
|
|
|
|
+static inline struct task_struct *
|
|
|
|
+choose_next_task(struct rq *rq, int cpu, struct task_struct *prev)
|
|
|
|
+choose_next_task(struct rq *rq, int cpu)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ struct task_struct *next;
|
|
|
|
+ struct task_struct *next;
|
|
|
|
+
|
|
|
|
+
|
|
|
@@ -5334,7 +5335,7 @@ index 000000000000..572eab74418f
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ check_curr(prev, rq);
|
|
|
|
+ check_curr(prev, rq);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ next = choose_next_task(rq, cpu, prev);
|
|
|
|
+ next = choose_next_task(rq, cpu);
|
|
|
|
+ clear_tsk_need_resched(prev);
|
|
|
|
+ clear_tsk_need_resched(prev);
|
|
|
|
+ clear_preempt_need_resched();
|
|
|
|
+ clear_preempt_need_resched();
|
|
|
|
+#ifdef CONFIG_SCHED_DEBUG
|
|
|
|
+#ifdef CONFIG_SCHED_DEBUG
|
|
|
@@ -5764,6 +5765,7 @@ index 000000000000..572eab74418f
|
|
|
|
+ return;
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ rq = __task_access_lock(p, &lock);
|
|
|
|
+ rq = __task_access_lock(p, &lock);
|
|
|
|
|
|
|
|
+ update_rq_clock(rq);
|
|
|
|
+ /*
|
|
|
|
+ /*
|
|
|
|
+ * Set under pi_lock && rq->lock, such that the value can be used under
|
|
|
|
+ * Set under pi_lock && rq->lock, such that the value can be used under
|
|
|
|
+ * either lock.
|
|
|
|
+ * either lock.
|
|
|
@@ -6643,6 +6645,13 @@ index 000000000000..572eab74418f
|
|
|
|
+ return retval;
|
|
|
|
+ return retval;
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SMP
|
|
|
|
|
|
|
|
+int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
+static int
|
|
|
|
+__sched_setaffinity(struct task_struct *p, const struct cpumask *mask)
|
|
|
|
+__sched_setaffinity(struct task_struct *p, const struct cpumask *mask)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
@@ -8027,6 +8036,14 @@ index 000000000000..572eab74418f
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ sched_smp_initialized = true;
|
|
|
|
+ sched_smp_initialized = true;
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+static int __init migration_init(void)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ sched_cpu_starting(smp_processor_id());
|
|
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
+early_initcall(migration_init);
|
|
|
|
|
|
|
|
+
|
|
|
|
+#else
|
|
|
|
+#else
|
|
|
|
+void __init sched_init_smp(void)
|
|
|
|
+void __init sched_init_smp(void)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
@@ -8636,14 +8653,15 @@ index 000000000000..1212a031700e
|
|
|
|
+{}
|
|
|
|
+{}
|
|
|
|
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
|
|
|
|
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
|
|
|
|
new file mode 100644
|
|
|
|
new file mode 100644
|
|
|
|
index 000000000000..e3b6320a397a
|
|
|
|
index 000000000000..c32403ed82b6
|
|
|
|
--- /dev/null
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/kernel/sched/alt_sched.h
|
|
|
|
+++ b/kernel/sched/alt_sched.h
|
|
|
|
@@ -0,0 +1,667 @@
|
|
|
|
@@ -0,0 +1,668 @@
|
|
|
|
+#ifndef ALT_SCHED_H
|
|
|
|
+#ifndef ALT_SCHED_H
|
|
|
|
+#define ALT_SCHED_H
|
|
|
|
+#define ALT_SCHED_H
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#include <linux/context_tracking.h>
|
|
|
|
+#include <linux/context_tracking.h>
|
|
|
|
|
|
|
|
+#include <linux/profile.h>
|
|
|
|
+#include <linux/psi.h>
|
|
|
|
+#include <linux/psi.h>
|
|
|
|
+#include <linux/stop_machine.h>
|
|
|
|
+#include <linux/stop_machine.h>
|
|
|
|
+#include <linux/syscalls.h>
|
|
|
|
+#include <linux/syscalls.h>
|
|
|
@@ -9428,23 +9446,23 @@ index d9dc9ab3773f..71a25540d65e 100644
|
|
|
|
--- a/kernel/sched/build_policy.c
|
|
|
|
--- a/kernel/sched/build_policy.c
|
|
|
|
+++ b/kernel/sched/build_policy.c
|
|
|
|
+++ b/kernel/sched/build_policy.c
|
|
|
|
@@ -42,13 +42,19 @@
|
|
|
|
@@ -42,13 +42,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "idle.c"
|
|
|
|
#include "idle.c"
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
#include "rt.c"
|
|
|
|
#include "rt.c"
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
# include "cpudeadline.c"
|
|
|
|
# include "cpudeadline.c"
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
# include "pelt.c"
|
|
|
|
# include "pelt.c"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "cputime.c"
|
|
|
|
#include "cputime.c"
|
|
|
|
-#include "deadline.c"
|
|
|
|
-#include "deadline.c"
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#include "deadline.c"
|
|
|
|
+#include "deadline.c"
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
@@ -9453,7 +9471,7 @@ index 99bdd96f454f..23f80a86d2d7 100644
|
|
|
|
--- a/kernel/sched/build_utility.c
|
|
|
|
--- a/kernel/sched/build_utility.c
|
|
|
|
+++ b/kernel/sched/build_utility.c
|
|
|
|
+++ b/kernel/sched/build_utility.c
|
|
|
|
@@ -85,7 +85,9 @@
|
|
|
|
@@ -85,7 +85,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
# include "cpupri.c"
|
|
|
|
# include "cpupri.c"
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
@@ -9461,14 +9479,14 @@ index 99bdd96f454f..23f80a86d2d7 100644
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
# include "topology.c"
|
|
|
|
# include "topology.c"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
|
|
|
|
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
|
|
|
|
index 1207c78f85c1..68812e0756cb 100644
|
|
|
|
index 1207c78f85c1..68812e0756cb 100644
|
|
|
|
--- a/kernel/sched/cpufreq_schedutil.c
|
|
|
|
--- a/kernel/sched/cpufreq_schedutil.c
|
|
|
|
+++ b/kernel/sched/cpufreq_schedutil.c
|
|
|
|
+++ b/kernel/sched/cpufreq_schedutil.c
|
|
|
|
@@ -159,9 +159,14 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu)
|
|
|
|
@@ -159,9 +159,14 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu)
|
|
|
|
struct rq *rq = cpu_rq(sg_cpu->cpu);
|
|
|
|
struct rq *rq = cpu_rq(sg_cpu->cpu);
|
|
|
|
|
|
|
|
|
|
|
|
sg_cpu->max = arch_scale_cpu_capacity(sg_cpu->cpu);
|
|
|
|
sg_cpu->max = arch_scale_cpu_capacity(sg_cpu->cpu);
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
sg_cpu->bw_dl = cpu_bw_dl(rq);
|
|
|
|
sg_cpu->bw_dl = cpu_bw_dl(rq);
|
|
|
@@ -9479,7 +9497,7 @@ index 1207c78f85c1..68812e0756cb 100644
|
|
|
|
+ sg_cpu->util = rq_load_util(rq, sg_cpu->max);
|
|
|
|
+ sg_cpu->util = rq_load_util(rq, sg_cpu->max);
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -305,8 +310,10 @@ static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; }
|
|
|
|
@@ -305,8 +310,10 @@ static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; }
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@@ -9490,11 +9508,11 @@ index 1207c78f85c1..68812e0756cb 100644
|
|
|
|
sg_cpu->sg_policy->limits_changed = true;
|
|
|
|
sg_cpu->sg_policy->limits_changed = true;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool sugov_update_single_common(struct sugov_cpu *sg_cpu,
|
|
|
|
static inline bool sugov_update_single_common(struct sugov_cpu *sg_cpu,
|
|
|
|
@@ -606,6 +613,7 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
|
|
|
|
@@ -606,6 +613,7 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ret = sched_setattr_nocheck(thread, &attr);
|
|
|
|
ret = sched_setattr_nocheck(thread, &attr);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
if (ret) {
|
|
|
|
if (ret) {
|
|
|
@@ -9509,7 +9527,7 @@ index 1207c78f85c1..68812e0756cb 100644
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static DECLARE_WORK(rebuild_sd_work, rebuild_sd_workfn);
|
|
|
|
static DECLARE_WORK(rebuild_sd_work, rebuild_sd_workfn);
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
|
|
|
|
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
|
|
|
|
index 95fc77853743..b48b3f9ed47f 100644
|
|
|
|
index 95fc77853743..b48b3f9ed47f 100644
|
|
|
|
--- a/kernel/sched/cputime.c
|
|
|
|
--- a/kernel/sched/cputime.c
|
|
|
@@ -9517,15 +9535,15 @@ index 95fc77853743..b48b3f9ed47f 100644
|
|
|
|
@@ -122,7 +122,7 @@ void account_user_time(struct task_struct *p, u64 cputime)
|
|
|
|
@@ -122,7 +122,7 @@ void account_user_time(struct task_struct *p, u64 cputime)
|
|
|
|
p->utime += cputime;
|
|
|
|
p->utime += cputime;
|
|
|
|
account_group_user_time(p, cputime);
|
|
|
|
account_group_user_time(p, cputime);
|
|
|
|
|
|
|
|
|
|
|
|
- index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
|
|
|
|
- index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
|
|
|
|
+ index = task_running_nice(p) ? CPUTIME_NICE : CPUTIME_USER;
|
|
|
|
+ index = task_running_nice(p) ? CPUTIME_NICE : CPUTIME_USER;
|
|
|
|
|
|
|
|
|
|
|
|
/* Add user time to cpustat. */
|
|
|
|
/* Add user time to cpustat. */
|
|
|
|
task_group_account_field(p, index, cputime);
|
|
|
|
task_group_account_field(p, index, cputime);
|
|
|
|
@@ -146,7 +146,7 @@ void account_guest_time(struct task_struct *p, u64 cputime)
|
|
|
|
@@ -146,7 +146,7 @@ void account_guest_time(struct task_struct *p, u64 cputime)
|
|
|
|
p->gtime += cputime;
|
|
|
|
p->gtime += cputime;
|
|
|
|
|
|
|
|
|
|
|
|
/* Add guest time to cpustat. */
|
|
|
|
/* Add guest time to cpustat. */
|
|
|
|
- if (task_nice(p) > 0) {
|
|
|
|
- if (task_nice(p) > 0) {
|
|
|
|
+ if (task_running_nice(p)) {
|
|
|
|
+ if (task_running_nice(p)) {
|
|
|
@@ -9543,12 +9561,12 @@ index 95fc77853743..b48b3f9ed47f 100644
|
|
|
|
static u64 read_sum_exec_runtime(struct task_struct *t)
|
|
|
|
static u64 read_sum_exec_runtime(struct task_struct *t)
|
|
|
|
@@ -294,7 +294,7 @@ static u64 read_sum_exec_runtime(struct task_struct *t)
|
|
|
|
@@ -294,7 +294,7 @@ static u64 read_sum_exec_runtime(struct task_struct *t)
|
|
|
|
struct rq *rq;
|
|
|
|
struct rq *rq;
|
|
|
|
|
|
|
|
|
|
|
|
rq = task_rq_lock(t, &rf);
|
|
|
|
rq = task_rq_lock(t, &rf);
|
|
|
|
- ns = t->se.sum_exec_runtime;
|
|
|
|
- ns = t->se.sum_exec_runtime;
|
|
|
|
+ ns = tsk_seruntime(t);
|
|
|
|
+ ns = tsk_seruntime(t);
|
|
|
|
task_rq_unlock(rq, t, &rf);
|
|
|
|
task_rq_unlock(rq, t, &rf);
|
|
|
|
|
|
|
|
|
|
|
|
return ns;
|
|
|
|
return ns;
|
|
|
|
@@ -626,7 +626,7 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
|
|
|
|
@@ -626,7 +626,7 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
|
|
|
|
void task_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st)
|
|
|
|
void task_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st)
|
|
|
@@ -9557,7 +9575,7 @@ index 95fc77853743..b48b3f9ed47f 100644
|
|
|
|
- .sum_exec_runtime = p->se.sum_exec_runtime,
|
|
|
|
- .sum_exec_runtime = p->se.sum_exec_runtime,
|
|
|
|
+ .sum_exec_runtime = tsk_seruntime(p),
|
|
|
|
+ .sum_exec_runtime = tsk_seruntime(p),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (task_cputime(p, &cputime.utime, &cputime.stime))
|
|
|
|
if (task_cputime(p, &cputime.utime, &cputime.stime))
|
|
|
|
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
|
|
|
|
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
|
|
|
|
index 1637b65ba07a..033c6deeb515 100644
|
|
|
|
index 1637b65ba07a..033c6deeb515 100644
|
|
|
@@ -9566,39 +9584,39 @@ index 1637b65ba07a..033c6deeb515 100644
|
|
|
|
@@ -7,6 +7,7 @@
|
|
|
|
@@ -7,6 +7,7 @@
|
|
|
|
* Copyright(C) 2007, Red Hat, Inc., Ingo Molnar
|
|
|
|
* Copyright(C) 2007, Red Hat, Inc., Ingo Molnar
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* This allows printing both to /proc/sched_debug and
|
|
|
|
* This allows printing both to /proc/sched_debug and
|
|
|
|
* to the console
|
|
|
|
* to the console
|
|
|
|
@@ -215,6 +216,7 @@ static const struct file_operations sched_scaling_fops = {
|
|
|
|
@@ -215,6 +216,7 @@ static const struct file_operations sched_scaling_fops = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SMP */
|
|
|
|
#endif /* SMP */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_PREEMPT_DYNAMIC
|
|
|
|
#ifdef CONFIG_PREEMPT_DYNAMIC
|
|
|
|
|
|
|
|
|
|
|
|
@@ -278,6 +280,7 @@ static const struct file_operations sched_dynamic_fops = {
|
|
|
|
@@ -278,6 +280,7 @@ static const struct file_operations sched_dynamic_fops = {
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* CONFIG_PREEMPT_DYNAMIC */
|
|
|
|
#endif /* CONFIG_PREEMPT_DYNAMIC */
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
__read_mostly bool sched_debug_verbose;
|
|
|
|
__read_mostly bool sched_debug_verbose;
|
|
|
|
|
|
|
|
|
|
|
|
static const struct seq_operations sched_debug_sops;
|
|
|
|
static const struct seq_operations sched_debug_sops;
|
|
|
|
@@ -293,6 +296,7 @@ static const struct file_operations sched_debug_fops = {
|
|
|
|
@@ -293,6 +296,7 @@ static const struct file_operations sched_debug_fops = {
|
|
|
|
.llseek = seq_lseek,
|
|
|
|
.llseek = seq_lseek,
|
|
|
|
.release = seq_release,
|
|
|
|
.release = seq_release,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
static struct dentry *debugfs_sched;
|
|
|
|
static struct dentry *debugfs_sched;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -302,12 +306,15 @@ static __init int sched_init_debug(void)
|
|
|
|
@@ -302,12 +306,15 @@ static __init int sched_init_debug(void)
|
|
|
|
|
|
|
|
|
|
|
|
debugfs_sched = debugfs_create_dir("sched", NULL);
|
|
|
|
debugfs_sched = debugfs_create_dir("sched", NULL);
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
debugfs_create_file("features", 0644, debugfs_sched, NULL, &sched_feat_fops);
|
|
|
|
debugfs_create_file("features", 0644, debugfs_sched, NULL, &sched_feat_fops);
|
|
|
|
debugfs_create_bool("verbose", 0644, debugfs_sched, &sched_debug_verbose);
|
|
|
|
debugfs_create_bool("verbose", 0644, debugfs_sched, &sched_debug_verbose);
|
|
|
@@ -9606,31 +9624,31 @@ index 1637b65ba07a..033c6deeb515 100644
|
|
|
|
#ifdef CONFIG_PREEMPT_DYNAMIC
|
|
|
|
#ifdef CONFIG_PREEMPT_DYNAMIC
|
|
|
|
debugfs_create_file("preempt", 0644, debugfs_sched, NULL, &sched_dynamic_fops);
|
|
|
|
debugfs_create_file("preempt", 0644, debugfs_sched, NULL, &sched_dynamic_fops);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
debugfs_create_u32("latency_ns", 0644, debugfs_sched, &sysctl_sched_latency);
|
|
|
|
debugfs_create_u32("latency_ns", 0644, debugfs_sched, &sysctl_sched_latency);
|
|
|
|
debugfs_create_u32("min_granularity_ns", 0644, debugfs_sched, &sysctl_sched_min_granularity);
|
|
|
|
debugfs_create_u32("min_granularity_ns", 0644, debugfs_sched, &sysctl_sched_min_granularity);
|
|
|
|
debugfs_create_u32("idle_min_granularity_ns", 0644, debugfs_sched, &sysctl_sched_idle_min_granularity);
|
|
|
|
debugfs_create_u32("idle_min_granularity_ns", 0644, debugfs_sched, &sysctl_sched_idle_min_granularity);
|
|
|
|
@@ -337,11 +344,13 @@ static __init int sched_init_debug(void)
|
|
|
|
@@ -337,11 +344,13 @@ static __init int sched_init_debug(void)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
debugfs_create_file("debug", 0444, debugfs_sched, NULL, &sched_debug_fops);
|
|
|
|
debugfs_create_file("debug", 0444, debugfs_sched, NULL, &sched_debug_fops);
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
late_initcall(sched_init_debug);
|
|
|
|
late_initcall(sched_init_debug);
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
|
|
|
|
|
|
|
|
static cpumask_var_t sd_sysctl_cpus;
|
|
|
|
static cpumask_var_t sd_sysctl_cpus;
|
|
|
|
@@ -1068,6 +1077,7 @@ void proc_sched_set_task(struct task_struct *p)
|
|
|
|
@@ -1068,6 +1077,7 @@ void proc_sched_set_task(struct task_struct *p)
|
|
|
|
memset(&p->stats, 0, sizeof(p->stats));
|
|
|
|
memset(&p->stats, 0, sizeof(p->stats));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* !CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
void resched_latency_warn(int cpu, u64 latency)
|
|
|
|
void resched_latency_warn(int cpu, u64 latency)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
|
|
|
|
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
|
|
|
@@ -9640,7 +9658,7 @@ index f26ab2675f7d..480d4ad16d45 100644
|
|
|
|
@@ -400,6 +400,7 @@ void cpu_startup_entry(enum cpuhp_state state)
|
|
|
|
@@ -400,6 +400,7 @@ void cpu_startup_entry(enum cpuhp_state state)
|
|
|
|
do_idle();
|
|
|
|
do_idle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* idle-task scheduling class.
|
|
|
|
* idle-task scheduling class.
|
|
|
@@ -9790,17 +9808,17 @@ index 0f310768260c..bd38bf738fe9 100644
|
|
|
|
@@ -266,6 +266,7 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load)
|
|
|
|
@@ -266,6 +266,7 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load)
|
|
|
|
WRITE_ONCE(sa->util_avg, sa->util_sum / divider);
|
|
|
|
WRITE_ONCE(sa->util_avg, sa->util_sum / divider);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* sched_entity:
|
|
|
|
* sched_entity:
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -383,8 +384,9 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
|
|
|
|
@@ -383,8 +384,9 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_SCHED_THERMAL_PRESSURE
|
|
|
|
-#ifdef CONFIG_SCHED_THERMAL_PRESSURE
|
|
|
|
+#if defined(CONFIG_SCHED_THERMAL_PRESSURE) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
+#if defined(CONFIG_SCHED_THERMAL_PRESSURE) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@@ -9813,7 +9831,7 @@ index 3a0e0dc28721..e8a7d84aa5a5 100644
|
|
|
|
@@ -1,13 +1,15 @@
|
|
|
|
@@ -1,13 +1,15 @@
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#include "sched-pelt.h"
|
|
|
|
#include "sched-pelt.h"
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
int __update_load_avg_blocked_se(u64 now, struct sched_entity *se);
|
|
|
|
int __update_load_avg_blocked_se(u64 now, struct sched_entity *se);
|
|
|
|
int __update_load_avg_se(u64 now, struct cfs_rq *cfs_rq, struct sched_entity *se);
|
|
|
|
int __update_load_avg_se(u64 now, struct cfs_rq *cfs_rq, struct sched_entity *se);
|
|
|
@@ -9821,16 +9839,16 @@ index 3a0e0dc28721..e8a7d84aa5a5 100644
|
|
|
|
int update_rt_rq_load_avg(u64 now, struct rq *rq, int running);
|
|
|
|
int update_rt_rq_load_avg(u64 now, struct rq *rq, int running);
|
|
|
|
int update_dl_rq_load_avg(u64 now, struct rq *rq, int running);
|
|
|
|
int update_dl_rq_load_avg(u64 now, struct rq *rq, int running);
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_SCHED_THERMAL_PRESSURE
|
|
|
|
-#ifdef CONFIG_SCHED_THERMAL_PRESSURE
|
|
|
|
+#if defined(CONFIG_SCHED_THERMAL_PRESSURE) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
+#if defined(CONFIG_SCHED_THERMAL_PRESSURE) && !defined(CONFIG_SCHED_ALT)
|
|
|
|
int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity);
|
|
|
|
int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity);
|
|
|
|
|
|
|
|
|
|
|
|
static inline u64 thermal_load_avg(struct rq *rq)
|
|
|
|
static inline u64 thermal_load_avg(struct rq *rq)
|
|
|
|
@@ -44,6 +46,7 @@ static inline u32 get_pelt_divider(struct sched_avg *avg)
|
|
|
|
@@ -44,6 +46,7 @@ static inline u32 get_pelt_divider(struct sched_avg *avg)
|
|
|
|
return PELT_MIN_DIVIDER + avg->period_contrib;
|
|
|
|
return PELT_MIN_DIVIDER + avg->period_contrib;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
static inline void cfs_se_util_change(struct sched_avg *avg)
|
|
|
|
static inline void cfs_se_util_change(struct sched_avg *avg)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -9840,9 +9858,9 @@ index 3a0e0dc28721..e8a7d84aa5a5 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
|
|
|
|
update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
|
|
|
@@ -9852,7 +9870,7 @@ index 3a0e0dc28721..e8a7d84aa5a5 100644
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity)
|
|
|
|
update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity)
|
|
|
|
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
|
|
|
|
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
|
|
|
@@ -9862,7 +9880,7 @@ index a4a20046e586..c363693cd869 100644
|
|
|
|
@@ -5,6 +5,10 @@
|
|
|
|
@@ -5,6 +5,10 @@
|
|
|
|
#ifndef _KERNEL_SCHED_SCHED_H
|
|
|
|
#ifndef _KERNEL_SCHED_SCHED_H
|
|
|
|
#define _KERNEL_SCHED_SCHED_H
|
|
|
|
#define _KERNEL_SCHED_SCHED_H
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#include "alt_sched.h"
|
|
|
|
+#include "alt_sched.h"
|
|
|
|
+#else
|
|
|
|
+#else
|
|
|
@@ -9873,7 +9891,7 @@ index a4a20046e586..c363693cd869 100644
|
|
|
|
@@ -3183,4 +3187,9 @@ static inline void update_current_exec_runtime(struct task_struct *curr,
|
|
|
|
@@ -3183,4 +3187,9 @@ static inline void update_current_exec_runtime(struct task_struct *curr,
|
|
|
|
cgroup_account_cputime(curr, delta_exec);
|
|
|
|
cgroup_account_cputime(curr, delta_exec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+static inline int task_running_nice(struct task_struct *p)
|
|
|
|
+static inline int task_running_nice(struct task_struct *p)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ return (task_nice(p) > 0);
|
|
|
|
+ return (task_nice(p) > 0);
|
|
|
@@ -9897,7 +9915,7 @@ index 857f837f52cb..5486c63e4790 100644
|
|
|
|
rq = cpu_rq(cpu);
|
|
|
|
rq = cpu_rq(cpu);
|
|
|
|
@@ -143,6 +145,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
|
|
|
|
@@ -143,6 +145,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
|
|
|
|
seq_printf(seq, "\n");
|
|
|
|
seq_printf(seq, "\n");
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
/* domain-specific stats */
|
|
|
|
/* domain-specific stats */
|
|
|
@@ -9916,9 +9934,9 @@ index 84a188913cc9..53934e7ef5db 100644
|
|
|
|
--- a/kernel/sched/stats.h
|
|
|
|
--- a/kernel/sched/stats.h
|
|
|
|
+++ b/kernel/sched/stats.h
|
|
|
|
+++ b/kernel/sched/stats.h
|
|
|
|
@@ -89,6 +89,7 @@ static inline void rq_sched_info_depart (struct rq *rq, unsigned long long delt
|
|
|
|
@@ -89,6 +89,7 @@ static inline void rq_sched_info_depart (struct rq *rq, unsigned long long delt
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* CONFIG_SCHEDSTATS */
|
|
|
|
#endif /* CONFIG_SCHEDSTATS */
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
|
|
#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
|
|
struct sched_entity_stats {
|
|
|
|
struct sched_entity_stats {
|
|
|
@@ -9928,7 +9946,7 @@ index 84a188913cc9..53934e7ef5db 100644
|
|
|
|
return &task_of(se)->stats;
|
|
|
|
return &task_of(se)->stats;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_PSI
|
|
|
|
#ifdef CONFIG_PSI
|
|
|
|
void psi_task_change(struct task_struct *task, int clear, int set);
|
|
|
|
void psi_task_change(struct task_struct *task, int clear, int set);
|
|
|
|
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
|
|
|
|
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
|
|
|
@@ -9938,37 +9956,37 @@ index 8739c2a5a54e..d8dd6c15eb47 100644
|
|
|
|
@@ -3,6 +3,7 @@
|
|
|
|
@@ -3,6 +3,7 @@
|
|
|
|
* Scheduler topology setup/handling methods
|
|
|
|
* Scheduler topology setup/handling methods
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
DEFINE_MUTEX(sched_domains_mutex);
|
|
|
|
DEFINE_MUTEX(sched_domains_mutex);
|
|
|
|
|
|
|
|
|
|
|
|
/* Protected by sched_domains_mutex: */
|
|
|
|
/* Protected by sched_domains_mutex: */
|
|
|
|
@@ -1413,8 +1414,10 @@ static void asym_cpu_capacity_scan(void)
|
|
|
|
@@ -1413,8 +1414,10 @@ static void asym_cpu_capacity_scan(void)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
static int default_relax_domain_level = -1;
|
|
|
|
static int default_relax_domain_level = -1;
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
int sched_domain_level_max;
|
|
|
|
int sched_domain_level_max;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
static int __init setup_relax_domain_level(char *str)
|
|
|
|
static int __init setup_relax_domain_level(char *str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (kstrtoint(str, 0, &default_relax_domain_level))
|
|
|
|
if (kstrtoint(str, 0, &default_relax_domain_level))
|
|
|
|
@@ -1647,6 +1650,7 @@ sd_init(struct sched_domain_topology_level *tl,
|
|
|
|
@@ -1647,6 +1650,7 @@ sd_init(struct sched_domain_topology_level *tl,
|
|
|
|
|
|
|
|
|
|
|
|
return sd;
|
|
|
|
return sd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
+#endif /* CONFIG_SCHED_ALT */
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Topology list, bottom-up.
|
|
|
|
* Topology list, bottom-up.
|
|
|
|
@@ -1683,6 +1687,7 @@ void set_sched_topology(struct sched_domain_topology_level *tl)
|
|
|
|
@@ -1683,6 +1687,7 @@ void set_sched_topology(struct sched_domain_topology_level *tl)
|
|
|
|
sched_domain_topology_saved = NULL;
|
|
|
|
sched_domain_topology_saved = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
|
|
|
|
|
|
|
|
static const struct cpumask *sd_numa_mask(int cpu)
|
|
|
|
static const struct cpumask *sd_numa_mask(int cpu)
|
|
|
|
@@ -2645,3 +2650,15 @@ void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
|
|
|
|
@@ -2645,3 +2650,15 @@ void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
|
|
|
|
partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
|
|
|
|
partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
|
|
|
@@ -9991,9 +10009,9 @@ index c6d9dec11b74..2bc42ce8b48e 100644
|
|
|
|
--- a/kernel/sysctl.c
|
|
|
|
--- a/kernel/sysctl.c
|
|
|
|
+++ b/kernel/sysctl.c
|
|
|
|
+++ b/kernel/sysctl.c
|
|
|
|
@@ -93,6 +93,10 @@ EXPORT_SYMBOL_GPL(sysctl_long_vals);
|
|
|
|
@@ -93,6 +93,10 @@ EXPORT_SYMBOL_GPL(sysctl_long_vals);
|
|
|
|
|
|
|
|
|
|
|
|
/* Constants used for minimum and maximum */
|
|
|
|
/* Constants used for minimum and maximum */
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+#ifdef CONFIG_SCHED_ALT
|
|
|
|
+extern int sched_yield_type;
|
|
|
|
+extern int sched_yield_type;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
@@ -10003,7 +10021,7 @@ index c6d9dec11b74..2bc42ce8b48e 100644
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@@ -1633,6 +1637,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
|
|
|
|
@@ -1633,6 +1637,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct ctl_table kern_table[] = {
|
|
|
|
static struct ctl_table kern_table[] = {
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
#ifdef CONFIG_NUMA_BALANCING
|
|
|
|
#ifdef CONFIG_NUMA_BALANCING
|
|
|
@@ -10042,13 +10060,13 @@ index 3ae661ab6260..35f0176dcdb0 100644
|
|
|
|
@@ -2088,8 +2088,10 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode,
|
|
|
|
@@ -2088,8 +2088,10 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode,
|
|
|
|
int ret = 0;
|
|
|
|
int ret = 0;
|
|
|
|
u64 slack;
|
|
|
|
u64 slack;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
slack = current->timer_slack_ns;
|
|
|
|
slack = current->timer_slack_ns;
|
|
|
|
if (dl_task(current) || rt_task(current))
|
|
|
|
if (dl_task(current) || rt_task(current))
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
slack = 0;
|
|
|
|
slack = 0;
|
|
|
|
|
|
|
|
|
|
|
|
hrtimer_init_sleeper_on_stack(&t, clockid, mode);
|
|
|
|
hrtimer_init_sleeper_on_stack(&t, clockid, mode);
|
|
|
|
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
|
|
|
|
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
|
|
|
|
index cb925e8ef9a8..67d823510f5c 100644
|
|
|
|
index cb925e8ef9a8..67d823510f5c 100644
|
|
|
@@ -10056,17 +10074,17 @@ index cb925e8ef9a8..67d823510f5c 100644
|
|
|
|
+++ b/kernel/time/posix-cpu-timers.c
|
|
|
|
+++ b/kernel/time/posix-cpu-timers.c
|
|
|
|
@@ -223,7 +223,7 @@ static void task_sample_cputime(struct task_struct *p, u64 *samples)
|
|
|
|
@@ -223,7 +223,7 @@ static void task_sample_cputime(struct task_struct *p, u64 *samples)
|
|
|
|
u64 stime, utime;
|
|
|
|
u64 stime, utime;
|
|
|
|
|
|
|
|
|
|
|
|
task_cputime(p, &utime, &stime);
|
|
|
|
task_cputime(p, &utime, &stime);
|
|
|
|
- store_samples(samples, stime, utime, p->se.sum_exec_runtime);
|
|
|
|
- store_samples(samples, stime, utime, p->se.sum_exec_runtime);
|
|
|
|
+ store_samples(samples, stime, utime, tsk_seruntime(p));
|
|
|
|
+ store_samples(samples, stime, utime, tsk_seruntime(p));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void proc_sample_cputime_atomic(struct task_cputime_atomic *at,
|
|
|
|
static void proc_sample_cputime_atomic(struct task_cputime_atomic *at,
|
|
|
|
@@ -866,6 +866,7 @@ static void collect_posix_cputimers(struct posix_cputimers *pct, u64 *samples,
|
|
|
|
@@ -866,6 +866,7 @@ static void collect_posix_cputimers(struct posix_cputimers *pct, u64 *samples,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
static inline void check_dl_overrun(struct task_struct *tsk)
|
|
|
|
static inline void check_dl_overrun(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -10076,18 +10094,18 @@ index cb925e8ef9a8..67d823510f5c 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
static bool check_rlimit(u64 time, u64 limit, int signo, bool rt, bool hard)
|
|
|
|
static bool check_rlimit(u64 time, u64 limit, int signo, bool rt, bool hard)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -900,8 +902,10 @@ static void check_thread_timers(struct task_struct *tsk,
|
|
|
|
@@ -900,8 +902,10 @@ static void check_thread_timers(struct task_struct *tsk,
|
|
|
|
u64 samples[CPUCLOCK_MAX];
|
|
|
|
u64 samples[CPUCLOCK_MAX];
|
|
|
|
unsigned long soft;
|
|
|
|
unsigned long soft;
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
if (dl_task(tsk))
|
|
|
|
if (dl_task(tsk))
|
|
|
|
check_dl_overrun(tsk);
|
|
|
|
check_dl_overrun(tsk);
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (expiry_cache_is_inactive(pct))
|
|
|
|
if (expiry_cache_is_inactive(pct))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@@ -915,7 +919,7 @@ static void check_thread_timers(struct task_struct *tsk,
|
|
|
|
@@ -915,7 +919,7 @@ static void check_thread_timers(struct task_struct *tsk,
|
|
|
@@ -10097,17 +10115,17 @@ index cb925e8ef9a8..67d823510f5c 100644
|
|
|
|
- unsigned long rttime = tsk->rt.timeout * (USEC_PER_SEC / HZ);
|
|
|
|
- unsigned long rttime = tsk->rt.timeout * (USEC_PER_SEC / HZ);
|
|
|
|
+ unsigned long rttime = tsk_rttimeout(tsk) * (USEC_PER_SEC / HZ);
|
|
|
|
+ unsigned long rttime = tsk_rttimeout(tsk) * (USEC_PER_SEC / HZ);
|
|
|
|
unsigned long hard = task_rlimit_max(tsk, RLIMIT_RTTIME);
|
|
|
|
unsigned long hard = task_rlimit_max(tsk, RLIMIT_RTTIME);
|
|
|
|
|
|
|
|
|
|
|
|
/* At the hard limit, send SIGKILL. No further action. */
|
|
|
|
/* At the hard limit, send SIGKILL. No further action. */
|
|
|
|
@@ -1151,8 +1155,10 @@ static inline bool fastpath_timer_check(struct task_struct *tsk)
|
|
|
|
@@ -1151,8 +1155,10 @@ static inline bool fastpath_timer_check(struct task_struct *tsk)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
+#ifndef CONFIG_SCHED_ALT
|
|
|
|
if (dl_task(tsk) && tsk->dl.dl_overrun)
|
|
|
|
if (dl_task(tsk) && tsk->dl.dl_overrun)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
|
|
|
|
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
|
|
|
@@ -10129,4 +10147,4 @@ index a2d301f58ced..2ccdede8585c 100644
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
};
|
|
|
|
};
|
|
|
|
struct wakeup_test_data *x = data;
|
|
|
|
struct wakeup_test_data *x = data;
|
|
|
|
|
|
|
|
|