From: Tadeusz Struk <tadeusz.struk@linaro.org>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>, peterz@infradead.org
Cc: Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Zhang Qiao <zhangqiao22@huawei.com>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
stable@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+af7a719bc92395ee41b3@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] sched/fair: Fix fault in reweight_entity
Date: Wed, 26 Jan 2022 15:50:57 -0800 [thread overview]
Message-ID: <a4eccced-44d9-d5ae-27b3-5b2832d22561@linaro.org> (raw)
In-Reply-To: <bb01425b-0f6a-e69f-c24b-567821c1472f@arm.com>
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
next prev parent reply other threads:[~2022-01-26 23:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 19:34 [PATCH v3] sched/fair: Fix fault in reweight_entity Tadeusz Struk
2022-01-26 13:53 ` Dietmar Eggemann
2022-01-26 23:50 ` Tadeusz Struk [this message]
2022-01-27 20:56 ` [PATCH v4] " Tadeusz Struk
2022-02-03 9:40 ` Dietmar Eggemann
2022-02-03 16:14 ` Tadeusz Struk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4eccced-44d9-d5ae-27b3-5b2832d22561@linaro.org \
--to=tadeusz.struk@linaro.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=daniel.m.jordan@oracle.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+af7a719bc92395ee41b3@syzkaller.appspotmail.com \
--cc=vincent.guittot@linaro.org \
--cc=zhangqiao22@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).