linux513-tkg: Update cacule patchset - https://github.com/hamadmarri/cacule-cpu-scheduler/blob/master/patches/CacULE/v5.13/cacule-5.13.patch
This commit is contained in:
2
PKGBUILD
2
PKGBUILD
@@ -524,7 +524,7 @@ case $_basever in
|
||||
'ef48eea194c1c101de0461572eaf311f232fee55c155c52904b20085a92db680'
|
||||
'5efd40c392ece498d2d43d5443e6537c2d9ef7cf9820d5ce80b6577fc5d1a4b2'
|
||||
'e5ea0bb25ee294c655ac3cc30e1eea497799826108fbfb4ef3258c676c1e8a12'
|
||||
'97d7f9ebecfe12d3b4be73f530c110936cc9bdc5a08303af09711398b64d418d'
|
||||
'e131e63149b7beb83e172337c74e3ab6b2d48888946edef6cd77beab93ca5d2a'
|
||||
'fca63d15ca4502aebd73e76d7499b243d2c03db71ff5ab0bf5cf268b2e576320'
|
||||
'19661ec0d39f9663452b34433214c755179894528bf73a42f6ba52ccf572832a'
|
||||
'9ec679871cba674cf876ba836cde969296ae5034bcc10e1ec39b372e6e07aab0'
|
||||
|
@@ -192,10 +192,10 @@ index 38ef6d06888e..865f8dbddca8 100644
|
||||
config SCHED_HRTICK
|
||||
def_bool HIGH_RES_TIMERS
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index 4ca80df205ce..520fb9991e04 100644
|
||||
index e5858999b54d..bdedde199504 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -3574,6 +3574,11 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
@@ -3578,6 +3578,11 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
p->se.prev_sum_exec_runtime = 0;
|
||||
p->se.nr_migrations = 0;
|
||||
p->se.vruntime = 0;
|
||||
@@ -207,7 +207,7 @@ index 4ca80df205ce..520fb9991e04 100644
|
||||
INIT_LIST_HEAD(&p->se.group_node);
|
||||
|
||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||
@@ -3859,6 +3864,10 @@ void wake_up_new_task(struct task_struct *p)
|
||||
@@ -3863,6 +3868,10 @@ void wake_up_new_task(struct task_struct *p)
|
||||
update_rq_clock(rq);
|
||||
post_init_entity_util_avg(p);
|
||||
|
||||
@@ -218,7 +218,17 @@ index 4ca80df205ce..520fb9991e04 100644
|
||||
activate_task(rq, p, ENQUEUE_NOCLOCK);
|
||||
trace_sched_wakeup_new(p);
|
||||
check_preempt_curr(rq, p, WF_FORK);
|
||||
@@ -4690,6 +4699,7 @@ static void sched_tick_remote(struct work_struct *work)
|
||||
@@ -4674,7 +4683,9 @@ static void sched_tick_remote(struct work_struct *work)
|
||||
struct rq *rq = cpu_rq(cpu);
|
||||
struct task_struct *curr;
|
||||
struct rq_flags rf;
|
||||
+#if !defined(CONFIG_CACULE_SCHED)
|
||||
u64 delta;
|
||||
+#endif
|
||||
int os;
|
||||
|
||||
/*
|
||||
@@ -4694,6 +4705,7 @@ static void sched_tick_remote(struct work_struct *work)
|
||||
|
||||
update_rq_clock(rq);
|
||||
|
||||
@@ -226,7 +236,7 @@ index 4ca80df205ce..520fb9991e04 100644
|
||||
if (!is_idle_task(curr)) {
|
||||
/*
|
||||
* Make sure the next tick runs within a reasonable
|
||||
@@ -4698,6 +4708,8 @@ static void sched_tick_remote(struct work_struct *work)
|
||||
@@ -4702,6 +4714,8 @@ static void sched_tick_remote(struct work_struct *work)
|
||||
delta = rq_clock_task(rq) - curr->se.exec_start;
|
||||
WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3);
|
||||
}
|
||||
@@ -235,7 +245,7 @@ index 4ca80df205ce..520fb9991e04 100644
|
||||
curr->sched_class->task_tick(rq, curr, 0);
|
||||
|
||||
calc_load_nohz_remote(rq);
|
||||
@@ -8102,6 +8114,10 @@ void __init sched_init(void)
|
||||
@@ -8115,6 +8129,10 @@ void __init sched_init(void)
|
||||
BUG_ON(&dl_sched_class + 1 != &stop_sched_class);
|
||||
#endif
|
||||
|
||||
@@ -293,7 +303,7 @@ index c5aacbd492a1..adb021b7da8a 100644
|
||||
cfs_rq->nr_spread_over);
|
||||
SEQ_printf(m, " .%-30s: %d\n", "nr_running", cfs_rq->nr_running);
|
||||
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
||||
index 23663318fb81..162395e3fda2 100644
|
||||
index e807b743353d..ddb9e65b0381 100644
|
||||
--- a/kernel/sched/fair.c
|
||||
+++ b/kernel/sched/fair.c
|
||||
@@ -19,9 +19,25 @@
|
||||
@@ -358,7 +368,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
|
||||
{
|
||||
s64 delta = (s64)(vruntime - max_vruntime);
|
||||
@@ -585,7 +613,204 @@ static inline bool __entity_less(struct rb_node *a, const struct rb_node *b)
|
||||
@@ -585,7 +613,209 @@ static inline bool __entity_less(struct rb_node *a, const struct rb_node *b)
|
||||
{
|
||||
return entity_before(__node_2_se(a), __node_2_se(b));
|
||||
}
|
||||
@@ -400,9 +410,14 @@ index 23663318fb81..162395e3fda2 100644
|
||||
+ return calc_interactivity(sched_clock(), cn) < interactivity_threshold;
|
||||
+}
|
||||
+
|
||||
+static inline int cn_has_idle_policy(struct cacule_node *se)
|
||||
+static inline int cn_has_idle_policy(struct cacule_node *cn)
|
||||
+{
|
||||
+ return task_has_idle_policy(task_of(se_of(se)));
|
||||
+ struct sched_entity *se = se_of(cn);
|
||||
+
|
||||
+ if (!entity_is_task(se))
|
||||
+ return false;
|
||||
+
|
||||
+ return task_has_idle_policy(task_of(se));
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
@@ -427,7 +442,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
+
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
|
||||
+/*
|
||||
+ * Does se have lower interactivity score value (i.e. interactive) than curr? If yes, return 1,
|
||||
+ * otherwise return -1
|
||||
@@ -460,7 +475,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
+
|
||||
+ return -1;
|
||||
+}
|
||||
|
||||
+
|
||||
+/*
|
||||
+ * Enqueue an entity
|
||||
+ */
|
||||
@@ -563,7 +578,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Enqueue an entity into the rb-tree:
|
||||
*/
|
||||
@@ -618,16 +843,24 @@ static struct sched_entity *__pick_next_entity(struct sched_entity *se)
|
||||
@@ -618,16 +848,24 @@ static struct sched_entity *__pick_next_entity(struct sched_entity *se)
|
||||
|
||||
return __node_2_se(next);
|
||||
}
|
||||
@@ -588,7 +603,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
@@ -717,6 +950,7 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -717,6 +955,7 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
return slice;
|
||||
}
|
||||
|
||||
@@ -596,7 +611,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* We calculate the vruntime slice of a to-be-inserted task.
|
||||
*
|
||||
@@ -726,6 +960,7 @@ static u64 sched_vslice(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -726,6 +965,7 @@ static u64 sched_vslice(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
{
|
||||
return calc_delta_fair(sched_slice(cfs_rq, se), se);
|
||||
}
|
||||
@@ -604,7 +619,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
#include "pelt.h"
|
||||
#ifdef CONFIG_SMP
|
||||
@@ -833,14 +1068,51 @@ static void update_tg_load_avg(struct cfs_rq *cfs_rq)
|
||||
@@ -833,14 +1073,51 @@ static void update_tg_load_avg(struct cfs_rq *cfs_rq)
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
@@ -656,7 +671,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (unlikely(!curr))
|
||||
return;
|
||||
@@ -857,8 +1129,15 @@ static void update_curr(struct cfs_rq *cfs_rq)
|
||||
@@ -857,8 +1134,15 @@ static void update_curr(struct cfs_rq *cfs_rq)
|
||||
curr->sum_exec_runtime += delta_exec;
|
||||
schedstat_add(cfs_rq->exec_clock, delta_exec);
|
||||
|
||||
@@ -672,7 +687,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (entity_is_task(curr)) {
|
||||
struct task_struct *curtask = task_of(curr);
|
||||
@@ -1026,7 +1305,6 @@ update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -1026,7 +1310,6 @@ update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
static inline void
|
||||
update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
{
|
||||
@@ -680,7 +695,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
if (!schedstat_enabled())
|
||||
return;
|
||||
|
||||
@@ -1058,7 +1336,11 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -1058,7 +1341,11 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
/*
|
||||
* We are starting a new run period:
|
||||
*/
|
||||
@@ -692,7 +707,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
@@ -4178,7 +4460,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) {}
|
||||
@@ -4178,7 +4465,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) {}
|
||||
|
||||
static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
{
|
||||
@@ -701,7 +716,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
s64 d = se->vruntime - cfs_rq->min_vruntime;
|
||||
|
||||
if (d < 0)
|
||||
@@ -4189,6 +4471,7 @@ static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -4189,6 +4476,7 @@ static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -709,7 +724,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static void
|
||||
place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
|
||||
{
|
||||
@@ -4220,6 +4503,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
|
||||
@@ -4220,6 +4508,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
|
||||
/* ensure we never gain time by being placed backwards. */
|
||||
se->vruntime = max_vruntime(se->vruntime, vruntime);
|
||||
}
|
||||
@@ -717,7 +732,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
static void check_enqueue_throttle(struct cfs_rq *cfs_rq);
|
||||
|
||||
@@ -4278,18 +4562,23 @@ static inline bool cfs_bandwidth_used(void);
|
||||
@@ -4278,18 +4567,23 @@ static inline bool cfs_bandwidth_used(void);
|
||||
static void
|
||||
enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
{
|
||||
@@ -741,7 +756,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Otherwise, renormalise after, such that we're placed at the current
|
||||
* moment in time, instead of some random moment in the past. Being
|
||||
@@ -4298,6 +4587,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4298,6 +4592,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
*/
|
||||
if (renorm && !curr)
|
||||
se->vruntime += cfs_rq->min_vruntime;
|
||||
@@ -749,7 +764,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* When enqueuing a sched_entity, we must:
|
||||
@@ -4312,8 +4602,10 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4312,8 +4607,10 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
update_cfs_group(se);
|
||||
account_entity_enqueue(cfs_rq, se);
|
||||
|
||||
@@ -760,7 +775,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
check_schedstat_required();
|
||||
update_stats_enqueue(cfs_rq, se, flags);
|
||||
@@ -4334,6 +4626,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4334,6 +4631,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
check_enqueue_throttle(cfs_rq);
|
||||
}
|
||||
|
||||
@@ -768,7 +783,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static void __clear_buddies_last(struct sched_entity *se)
|
||||
{
|
||||
for_each_sched_entity(se) {
|
||||
@@ -4378,6 +4671,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -4378,6 +4676,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
if (cfs_rq->skip == se)
|
||||
__clear_buddies_skip(se);
|
||||
}
|
||||
@@ -776,7 +791,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq);
|
||||
|
||||
@@ -4402,13 +4696,16 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4402,13 +4701,16 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
|
||||
update_stats_dequeue(cfs_rq, se, flags);
|
||||
|
||||
@@ -793,7 +808,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Normalize after update_curr(); which will also have moved
|
||||
* min_vruntime if @se is the one holding it back. But before doing
|
||||
@@ -4417,12 +4714,14 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4417,12 +4719,14 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
*/
|
||||
if (!(flags & DEQUEUE_SLEEP))
|
||||
se->vruntime -= cfs_rq->min_vruntime;
|
||||
@@ -808,7 +823,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Now advance min_vruntime if @se was the entity holding it back,
|
||||
* except when: DEQUEUE_SAVE && !DEQUEUE_MOVE, in this case we'll be
|
||||
@@ -4431,8 +4730,21 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
@@ -4431,8 +4735,21 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
*/
|
||||
if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) != DEQUEUE_SAVE)
|
||||
update_min_vruntime(cfs_rq);
|
||||
@@ -830,7 +845,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Preempt the current task with a newly woken task if needed:
|
||||
*/
|
||||
@@ -4472,6 +4784,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
||||
@@ -4472,6 +4789,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
||||
if (delta > ideal_runtime)
|
||||
resched_curr(rq_of(cfs_rq));
|
||||
}
|
||||
@@ -838,7 +853,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
static void
|
||||
set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -4506,6 +4819,21 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
@@ -4506,6 +4824,21 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
se->prev_sum_exec_runtime = se->sum_exec_runtime;
|
||||
}
|
||||
|
||||
@@ -860,7 +875,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static int
|
||||
wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
|
||||
|
||||
@@ -4566,6 +4894,7 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
||||
@@ -4566,6 +4899,7 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
||||
|
||||
return se;
|
||||
}
|
||||
@@ -868,7 +883,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
static bool check_cfs_rq_runtime(struct cfs_rq *cfs_rq);
|
||||
|
||||
@@ -5668,7 +5997,9 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
@@ -5668,7 +6002,9 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
hrtick_update(rq);
|
||||
}
|
||||
|
||||
@@ -878,7 +893,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* The dequeue_task method is called before nr_running is
|
||||
@@ -5700,12 +6031,14 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
@@ -5700,12 +6036,14 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
if (cfs_rq->load.weight) {
|
||||
/* Avoid re-evaluating load for this entity: */
|
||||
se = parent_entity(se);
|
||||
@@ -893,7 +908,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
break;
|
||||
}
|
||||
flags |= DEQUEUE_SLEEP;
|
||||
@@ -5821,6 +6154,7 @@ static unsigned long capacity_of(int cpu)
|
||||
@@ -5821,6 +6159,7 @@ static unsigned long capacity_of(int cpu)
|
||||
return cpu_rq(cpu)->cpu_capacity;
|
||||
}
|
||||
|
||||
@@ -901,7 +916,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static void record_wakee(struct task_struct *p)
|
||||
{
|
||||
/*
|
||||
@@ -5867,6 +6201,7 @@ static int wake_wide(struct task_struct *p)
|
||||
@@ -5867,6 +6206,7 @@ static int wake_wide(struct task_struct *p)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -909,7 +924,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* The purpose of wake_affine() is to quickly determine on which CPU we can run
|
||||
@@ -6569,6 +6904,7 @@ static unsigned long cpu_util_without(int cpu, struct task_struct *p)
|
||||
@@ -6569,6 +6909,7 @@ static unsigned long cpu_util_without(int cpu, struct task_struct *p)
|
||||
return min_t(unsigned long, util, capacity_orig_of(cpu));
|
||||
}
|
||||
|
||||
@@ -917,7 +932,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Predicts what cpu_util(@cpu) would return if @p was migrated (and enqueued)
|
||||
* to @dst_cpu.
|
||||
@@ -6818,6 +7154,57 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
|
||||
@@ -6823,6 +7164,57 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -975,7 +990,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* select_task_rq_fair: Select target runqueue for the waking task in domains
|
||||
@@ -6842,6 +7229,26 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
|
||||
@@ -6847,6 +7239,26 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
|
||||
/* SD_flags and WF_flags share the first nibble */
|
||||
int sd_flag = wake_flags & 0xF;
|
||||
|
||||
@@ -1002,7 +1017,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
if (wake_flags & WF_TTWU) {
|
||||
record_wakee(p);
|
||||
|
||||
@@ -6854,6 +7261,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
|
||||
@@ -6859,6 +7271,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
|
||||
|
||||
want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr);
|
||||
}
|
||||
@@ -1010,7 +1025,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_domain(cpu, tmp) {
|
||||
@@ -6900,6 +7308,7 @@ static void detach_entity_cfs_rq(struct sched_entity *se);
|
||||
@@ -6905,6 +7318,7 @@ static void detach_entity_cfs_rq(struct sched_entity *se);
|
||||
*/
|
||||
static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
|
||||
{
|
||||
@@ -1018,7 +1033,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* As blocked tasks retain absolute vruntime the migration needs to
|
||||
* deal with this by subtracting the old and adding the new
|
||||
@@ -6925,6 +7334,7 @@ static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
|
||||
@@ -6930,6 +7344,7 @@ static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
|
||||
|
||||
se->vruntime -= min_vruntime;
|
||||
}
|
||||
@@ -1026,7 +1041,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (p->on_rq == TASK_ON_RQ_MIGRATING) {
|
||||
/*
|
||||
@@ -6970,6 +7380,7 @@ balance_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
|
||||
@@ -6975,6 +7390,7 @@ balance_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
@@ -1034,7 +1049,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static unsigned long wakeup_gran(struct sched_entity *se)
|
||||
{
|
||||
unsigned long gran = sysctl_sched_wakeup_granularity;
|
||||
@@ -7048,6 +7459,7 @@ static void set_skip_buddy(struct sched_entity *se)
|
||||
@@ -7053,6 +7469,7 @@ static void set_skip_buddy(struct sched_entity *se)
|
||||
for_each_sched_entity(se)
|
||||
cfs_rq_of(se)->skip = se;
|
||||
}
|
||||
@@ -1042,7 +1057,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* Preempt the current task with a newly woken task if needed:
|
||||
@@ -7056,9 +7468,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
@@ -7061,9 +7478,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
{
|
||||
struct task_struct *curr = rq->curr;
|
||||
struct sched_entity *se = &curr->se, *pse = &p->se;
|
||||
@@ -1055,7 +1070,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (unlikely(se == pse))
|
||||
return;
|
||||
@@ -7072,10 +7487,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
@@ -7077,10 +7497,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
if (unlikely(throttled_hierarchy(cfs_rq_of(pse))))
|
||||
return;
|
||||
|
||||
@@ -1068,7 +1083,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* We can come here with TIF_NEED_RESCHED already set from new task
|
||||
@@ -7105,6 +7522,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
@@ -7110,6 +7532,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
find_matching_se(&se, &pse);
|
||||
update_curr(cfs_rq_of(se));
|
||||
BUG_ON(!pse);
|
||||
@@ -1080,7 +1095,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
if (wakeup_preempt_entity(se, pse) == 1) {
|
||||
/*
|
||||
* Bias pick_next to pick the sched entity that is
|
||||
@@ -7114,11 +7536,14 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
@@ -7119,11 +7546,14 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
set_next_buddy(pse);
|
||||
goto preempt;
|
||||
}
|
||||
@@ -1095,7 +1110,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Only set the backward buddy when the current task is still
|
||||
* on the rq. This can happen when a wakeup gets interleaved
|
||||
@@ -7133,6 +7558,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
@@ -7138,6 +7568,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
||||
|
||||
if (sched_feat(LAST_BUDDY) && scale && entity_is_task(se))
|
||||
set_last_buddy(se);
|
||||
@@ -1103,7 +1118,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
}
|
||||
|
||||
struct task_struct *
|
||||
@@ -7307,7 +7733,10 @@ static void yield_task_fair(struct rq *rq)
|
||||
@@ -7312,7 +7743,10 @@ static void yield_task_fair(struct rq *rq)
|
||||
{
|
||||
struct task_struct *curr = rq->curr;
|
||||
struct cfs_rq *cfs_rq = task_cfs_rq(curr);
|
||||
@@ -1114,7 +1129,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* Are we the only task in the tree?
|
||||
@@ -7315,7 +7744,9 @@ static void yield_task_fair(struct rq *rq)
|
||||
@@ -7320,7 +7754,9 @@ static void yield_task_fair(struct rq *rq)
|
||||
if (unlikely(rq->nr_running == 1))
|
||||
return;
|
||||
|
||||
@@ -1124,7 +1139,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (curr->policy != SCHED_BATCH) {
|
||||
update_rq_clock(rq);
|
||||
@@ -7331,7 +7762,9 @@ static void yield_task_fair(struct rq *rq)
|
||||
@@ -7336,7 +7772,9 @@ static void yield_task_fair(struct rq *rq)
|
||||
rq_clock_skip_update(rq);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1149,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
}
|
||||
|
||||
static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
|
||||
@@ -7342,8 +7775,10 @@ static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
|
||||
@@ -7347,8 +7785,10 @@ static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
|
||||
if (!se->on_rq || throttled_hierarchy(cfs_rq_of(se)))
|
||||
return false;
|
||||
|
||||
@@ -1145,7 +1160,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
yield_task_fair(rq);
|
||||
|
||||
@@ -7570,6 +8005,7 @@ static int task_hot(struct task_struct *p, struct lb_env *env)
|
||||
@@ -7575,6 +8015,7 @@ static int task_hot(struct task_struct *p, struct lb_env *env)
|
||||
if (env->sd->flags & SD_SHARE_CPUCAPACITY)
|
||||
return 0;
|
||||
|
||||
@@ -1153,7 +1168,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
/*
|
||||
* Buddy candidates are cache hot:
|
||||
*/
|
||||
@@ -7577,6 +8013,7 @@ static int task_hot(struct task_struct *p, struct lb_env *env)
|
||||
@@ -7582,6 +8023,7 @@ static int task_hot(struct task_struct *p, struct lb_env *env)
|
||||
(&p->se == cfs_rq_of(&p->se)->next ||
|
||||
&p->se == cfs_rq_of(&p->se)->last))
|
||||
return 1;
|
||||
@@ -1161,7 +1176,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
if (sysctl_sched_migration_cost == -1)
|
||||
return 1;
|
||||
@@ -10587,9 +11024,11 @@ static void nohz_newidle_balance(struct rq *this_rq)
|
||||
@@ -10592,9 +11034,11 @@ static void nohz_newidle_balance(struct rq *this_rq)
|
||||
if (!housekeeping_cpu(this_cpu, HK_FLAG_SCHED))
|
||||
return;
|
||||
|
||||
@@ -1173,7 +1188,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/* Don't need to update blocked load of idle CPUs*/
|
||||
if (!READ_ONCE(nohz.has_blocked) ||
|
||||
@@ -10652,7 +11091,10 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
|
||||
@@ -10657,7 +11101,10 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
|
||||
*/
|
||||
rq_unpin_lock(this_rq, rf);
|
||||
|
||||
@@ -1185,7 +1200,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
!READ_ONCE(this_rq->rd->overload)) {
|
||||
|
||||
rcu_read_lock();
|
||||
@@ -10820,11 +11262,28 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
|
||||
@@ -10825,11 +11272,28 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
|
||||
update_overutilized_status(task_rq(curr));
|
||||
}
|
||||
|
||||
@@ -1214,7 +1229,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
static void task_fork_fair(struct task_struct *p)
|
||||
{
|
||||
struct cfs_rq *cfs_rq;
|
||||
@@ -10855,6 +11314,7 @@ static void task_fork_fair(struct task_struct *p)
|
||||
@@ -10860,6 +11324,7 @@ static void task_fork_fair(struct task_struct *p)
|
||||
se->vruntime -= cfs_rq->min_vruntime;
|
||||
rq_unlock(rq, &rf);
|
||||
}
|
||||
@@ -1222,7 +1237,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
/*
|
||||
* Priority of the task has changed. Check to see if we preempt
|
||||
@@ -10973,6 +11433,8 @@ static void attach_entity_cfs_rq(struct sched_entity *se)
|
||||
@@ -10978,6 +11443,8 @@ static void attach_entity_cfs_rq(struct sched_entity *se)
|
||||
static void detach_task_cfs_rq(struct task_struct *p)
|
||||
{
|
||||
struct sched_entity *se = &p->se;
|
||||
@@ -1231,7 +1246,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
struct cfs_rq *cfs_rq = cfs_rq_of(se);
|
||||
|
||||
if (!vruntime_normalized(p)) {
|
||||
@@ -10983,6 +11445,7 @@ static void detach_task_cfs_rq(struct task_struct *p)
|
||||
@@ -10988,6 +11455,7 @@ static void detach_task_cfs_rq(struct task_struct *p)
|
||||
place_entity(cfs_rq, se, 0);
|
||||
se->vruntime -= cfs_rq->min_vruntime;
|
||||
}
|
||||
@@ -1239,7 +1254,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
|
||||
detach_entity_cfs_rq(se);
|
||||
}
|
||||
@@ -10990,12 +11453,17 @@ static void detach_task_cfs_rq(struct task_struct *p)
|
||||
@@ -10995,12 +11463,17 @@ static void detach_task_cfs_rq(struct task_struct *p)
|
||||
static void attach_task_cfs_rq(struct task_struct *p)
|
||||
{
|
||||
struct sched_entity *se = &p->se;
|
||||
@@ -1257,7 +1272,7 @@ index 23663318fb81..162395e3fda2 100644
|
||||
}
|
||||
|
||||
static void switched_from_fair(struct rq *rq, struct task_struct *p)
|
||||
@@ -11051,13 +11519,22 @@ static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first)
|
||||
@@ -11056,13 +11529,22 @@ static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first)
|
||||
void init_cfs_rq(struct cfs_rq *cfs_rq)
|
||||
{
|
||||
cfs_rq->tasks_timeline = RB_ROOT_CACHED;
|
||||
|
Reference in New Issue
Block a user