From: Kayra Cizmeci <kayracizmeci@gmail.com>
To: vincent.guittot@linaro.org
Cc: bsegall@google.com, dietmar.eggemann@arm.com,
juri.lelli@redhat.com, kayracizmeci@gmail.com,
kprateek.nayak@amd.com, linux-kernel@vger.kernel.org,
mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
rostedt@goodmis.org, vschneid@redhat.com
Subject: Re: [PATCH v2 2/2] sched/fair: avoid recalculating curr status in place_entity() and requeue_delayed_entity()
Date: Fri, 11 Sep 2026 16:10:58 +0300 [thread overview]
Message-ID: <20260911131058.1220717-1-kayracizmeci@gmail.com> (raw)
In-Reply-To: <CAKfTPtBEKaYoEmkWRvsDWXsQxtnHnOFQiA6U_4PzQTJw0xtEEw@mail.gmail.com>
Hello Vincent,
>> @@ -6256,10 +6256,17 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
>> * vl_i = (W + w_i)*vl'_i / W
>> */
>> load = cfs_rq->sum_weight;
>> - if (curr && curr->on_rq)
>> - load += avg_vruntime_weight(cfs_rq, curr->h_load.weight);
>> + if (curr && (curr->on_rq || is_curr)) {
>> + curr_weight = avg_vruntime_weight(cfs_rq, curr->h_load.weight);
>> + if (curr->on_rq)
>> + load += curr_weight;
>> + }
>> +
>> + if (is_curr)
>> + weight = curr_weight;
>> + else
>> + weight = avg_vruntime_weight(cfs_rq, se->h_load.weight);
> This makes the code less readable and I don't think it gives any
> measurable benefit.
Well, yeah. 1 avg_vruntime_weight() less or much is not measurable
in any means.
The main thing I wanted was to handle curr == se case
on here.
Maybe we could remove this is_curr bool and look se == curr
in function, and remove this curr weight and let the curr use weight
instead. So, the curr_weightnbecomes weight, we could be done
with the if (is_curr) block since we don't need to set weight to curr_weight.
Well if you think handling curr == se separately is wrong, then I'll drop the patch.
Please let me know what you're thinking :-).
Thanks,
Kayra :_:
next prev parent reply other threads:[~2026-09-11 13:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 12:52 [PATCH 1/2] sched/fair: reuse the ENQUEUE_DELAYED calculation in enqueue_task_fair() Kayra Cizmeci
2026-08-24 12:52 ` [PATCH 2/2] sched/fair: avoid recalculating curr status in place_entity() and requeue_delayed_entity() Kayra Cizmeci
2026-08-26 10:15 ` [PATCH v2 0/2] sched/fair: reduce repeated work in enqueue path Kayra Cizmeci
2026-08-26 10:15 ` [PATCH v2 1/2] sched/fair: reuse the ENQUEUE_DELAYED calculation in enqueue_task_fair() Kayra Cizmeci
2026-08-26 10:41 ` K Prateek Nayak
2026-08-26 18:44 ` Kayra Cizmeci
2026-09-07 16:05 ` [PATCH] sched/fair: Remove unused autogroup.h include Kayra Cizmeci
2026-09-07 16:14 ` [PATCH v2 1/2] sched/fair: reuse the ENQUEUE_DELAYED calculation in enqueue_task_fair() Kayra Cizmeci
2026-08-26 10:15 ` [PATCH v2 2/2] sched/fair: avoid recalculating curr status in place_entity() and requeue_delayed_entity() Kayra Cizmeci
2026-09-11 10:57 ` Kayra Cizmeci
2026-09-11 12:19 ` Vincent Guittot
2026-09-11 13:10 ` Kayra Cizmeci [this message]
2026-09-11 12:42 ` Peter Zijlstra
2026-09-11 14:08 ` Kayra Cizmeci
2026-09-11 16:02 ` [PATCH v3] sched/fair: remove dead code on enqueue_task_fair() Kayra Cizmeci
2026-10-12 12:58 ` Christian Loehle
2026-10-12 13:33 ` Kayra Cizmeci
2026-10-12 14:02 ` Peter Zijlstra
2026-10-12 14:15 ` Kayra Cizmeci
2026-10-12 14:59 ` Christian Loehle
2026-10-13 11:58 ` Peter Zijlstra
2026-10-13 13:42 ` Kayra Cizmeci
2026-10-13 19:56 ` Christian Loehle
2026-10-15 7:42 ` Kayra Cizmeci
2026-10-15 7:49 ` Peter Zijlstra
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=20260911131058.1220717-1-kayracizmeci@gmail.com \
--to=kayracizmeci@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®