Re: [PATCH v2 1/2] sched/fair: reuse the ENQUEUE_DELAYED calculation in enqueue_task_fair()
From: Kayra Cizmeci
Date: Mon Sep 07 2026 - 12:22:52 EST
Hello Prateek,
>> @@ -7996,12 +7996,12 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
>> * Let's add the task's estimated utilization to the cfs_rq's
>> * estimated utilization, before we update schedutil.
>> */
>> - if (!p->se.sched_delayed || (flags & ENQUEUE_DELAYED))
>> + if (!p->se.sched_delayed || delayed)
> nit. This reads funny now - not delayed or delayed?
> Maybe wakeup_delayed but all of this should be optimized by compiler
> at the end and a big ENQUEUE_DELAYED is better for humans who are
> reading the code no?
In my first message I was thinking that renaming and using it in both places would be
the better approach. But I thought about this the meantime and I changed my mind.
flags & ENQUEUE_DELAYED reads better and more clear than a bool. And I can't really
see a big advantage of renaming it over this version.
Patch subject is a bit confusing since it says reuse the bla bla
calculation in the enqueue_task_fair(). And this subject
makes it seem like there is a performance claim.
I knew It was getting optimized by the compiler, I thought at the time that
gathering this flags & ENQUEUE_DELAYED in one place would be better.
I'm dropping this patch (1/2) but I'll continue with 2/2 :->.
NOTE: I send the wrong file that was with the same
name with my correct file that I supposed to send. Sorry for this autogroup.h
ping thing. Ah..
Thanks,
Kayra