lkml.org 
[lkml]   [2022]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] sched/fair: Fix fault in reweight_entity
On 1/26/22 05:53, Dietmar Eggemann wrote:
> Can we then not get rid of `bool update_load` parameter of
> set_load_weight() completely?
>
> @@ -1214,8 +1214,9 @@ int tg_nop(struct task_group *tg, void *data)
> }
> #endif
>
> -static void set_load_weight(struct task_struct *p, bool update_load)
> +static void set_load_weight(struct task_struct *p)
> {
> + int task_new = READ_ONCE(p->__state) & TASK_NEW;
> int prio = p->static_prio - MAX_RT_PRIO;
> struct load_weight *load = &p->se.load;
>
> @@ -1232,7 +1233,7 @@ static void set_load_weight(struct task_struct *p, bool update_load)
> * SCHED_OTHER tasks have to update their load when changing their
> * weight
> */
> - if (update_load && p->sched_class == &fair_sched_class) {
> + if (!task_new && p->sched_class == &fair_sched_class) {
> reweight_task(p, prio);
> } else {
> load->weight = scale_load(sched_prio_to_weight[prio]);

That will also work. Let's agree on the best way to fix it.
Peter, what's your preference?

--
Thanks,
Tadeusz

\
 
 \ /
  Last update: 2022-01-27 00:51    [W:0.056 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site