mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Revert "sched/fair: set_load_weight() must also call reweight_task() for SCHED_IDLE tasks"
This reverts commit e63c0422d2 which is
commit d329605287020c3d1c3b0dadc63d8208e7251382 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I53506770d54046f8b8c62edf1342aed9797f33f8
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -1294,24 +1294,27 @@ int tg_nop(struct task_group *tg, void *data)
|
|||||||
static void set_load_weight(struct task_struct *p, bool update_load)
|
static void set_load_weight(struct task_struct *p, bool update_load)
|
||||||
{
|
{
|
||||||
int prio = p->static_prio - MAX_RT_PRIO;
|
int prio = p->static_prio - MAX_RT_PRIO;
|
||||||
struct load_weight lw;
|
struct load_weight *load = &p->se.load;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SCHED_IDLE tasks get minimal weight:
|
||||||
|
*/
|
||||||
if (task_has_idle_policy(p)) {
|
if (task_has_idle_policy(p)) {
|
||||||
lw.weight = scale_load(WEIGHT_IDLEPRIO);
|
load->weight = scale_load(WEIGHT_IDLEPRIO);
|
||||||
lw.inv_weight = WMULT_IDLEPRIO;
|
load->inv_weight = WMULT_IDLEPRIO;
|
||||||
} else {
|
return;
|
||||||
lw.weight = scale_load(sched_prio_to_weight[prio]);
|
|
||||||
lw.inv_weight = sched_prio_to_wmult[prio];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SCHED_OTHER tasks have to update their load when changing their
|
* SCHED_OTHER tasks have to update their load when changing their
|
||||||
* weight
|
* weight
|
||||||
*/
|
*/
|
||||||
if (update_load && p->sched_class == &fair_sched_class)
|
if (update_load && p->sched_class == &fair_sched_class) {
|
||||||
reweight_task(p, &lw);
|
reweight_task(p, prio);
|
||||||
else
|
} else {
|
||||||
p->se.load = lw;
|
load->weight = scale_load(sched_prio_to_weight[prio]);
|
||||||
|
load->inv_weight = sched_prio_to_wmult[prio];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_UCLAMP_TASK
|
#ifdef CONFIG_UCLAMP_TASK
|
||||||
|
|||||||
@@ -3343,14 +3343,15 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void reweight_task(struct task_struct *p, const struct load_weight *lw)
|
void reweight_task(struct task_struct *p, int prio)
|
||||||
{
|
{
|
||||||
struct sched_entity *se = &p->se;
|
struct sched_entity *se = &p->se;
|
||||||
struct cfs_rq *cfs_rq = cfs_rq_of(se);
|
struct cfs_rq *cfs_rq = cfs_rq_of(se);
|
||||||
struct load_weight *load = &se->load;
|
struct load_weight *load = &se->load;
|
||||||
|
unsigned long weight = scale_load(sched_prio_to_weight[prio]);
|
||||||
|
|
||||||
reweight_entity(cfs_rq, se, lw->weight);
|
reweight_entity(cfs_rq, se, weight);
|
||||||
load->inv_weight = lw->inv_weight;
|
load->inv_weight = sched_prio_to_wmult[prio];
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(reweight_task);
|
EXPORT_SYMBOL_GPL(reweight_task);
|
||||||
|
|
||||||
|
|||||||
@@ -2394,7 +2394,7 @@ extern void init_sched_dl_class(void);
|
|||||||
extern void init_sched_rt_class(void);
|
extern void init_sched_rt_class(void);
|
||||||
extern void init_sched_fair_class(void);
|
extern void init_sched_fair_class(void);
|
||||||
|
|
||||||
extern void reweight_task(struct task_struct *p, const struct load_weight *lw);
|
extern void reweight_task(struct task_struct *p, int prio);
|
||||||
|
|
||||||
extern void resched_curr(struct rq *rq);
|
extern void resched_curr(struct rq *rq);
|
||||||
extern void resched_cpu(int cpu);
|
extern void resched_cpu(int cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user