mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Zihuan Zhang <zhangzihuan@kylinos.cn>,
	xuewen.yan@unisoc.com, vincent.guittot@linaro.org,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com
Cc: rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, hongyan.xia2@arm.com,
	linux-kernel@vger.kernel.org, ke.wang@unisoc.com,
	di.shen@unisoc.com, xuewen.yan94@gmail.com,
	kuyo.chang@mediatek.com, juju.sung@mediatek.com,
	qyousef@layalina.io
Subject: Re: [PATCH v1] sched/uclamp: Skip uclamp_rq_dec() for non-final dequeue of delayed tasks
Date: Wed, 2 Jul 2025 08:42:57 +0530	[thread overview]
Message-ID: <1b0a41ce-5fcc-4ea8-83ca-a2bd5ef765c9@amd.com> (raw)
In-Reply-To: <0396755a-58be-4f7d-99f9-6b63d35e6e65@kylinos.cn>

Hello Zihuan,

On 7/2/2025 6:23 AM, Zihuan Zhang wrote:
> As a follow-up question: would it make sense to defensively guard uclamp_rq_dec() with something like:
> if (!task_on_rq_queued(p))
> return;

uclamp_rq_dec() is only called from dequeue_task() and that
should only be called when task_on_rq_queued().

> I understand this is not required with the current call structure, but I wonder whether such a check would be reasonable to prevent accidental double-dec in case of future changes or obscure paths.
> Or would this be considered unnecessary runtime overhead and better caught by path analysis?

On a closer look at uclamp_rq_dec_id(), I think "uc_se->active"
will guard against a double accounting. But that is not a good
reason to sprinkle redundant calls.

-- 
Thanks and Regards,
Prateek


  reply	other threads:[~2025-07-02  3:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01  9:34 Zihuan Zhang
2025-07-01 10:49 ` Xuewen Yan
2025-07-02  0:48   ` Zihuan Zhang
2025-07-01 11:00 ` K Prateek Nayak
2025-07-02  0:53   ` Zihuan Zhang
2025-07-02  3:12     ` K Prateek Nayak [this message]
2025-07-03  9:03       ` Zihuan Zhang
2025-07-03 12:22     ` Christian Loehle

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=1b0a41ce-5fcc-4ea8-83ca-a2bd5ef765c9@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=bsegall@google.com \
    --cc=di.shen@unisoc.com \
    --cc=hongyan.xia2@arm.com \
    --cc=juju.sung@mediatek.com \
    --cc=juri.lelli@redhat.com \
    --cc=ke.wang@unisoc.com \
    --cc=kuyo.chang@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=xuewen.yan94@gmail.com \
    --cc=xuewen.yan@unisoc.com \
    --cc=zhangzihuan@kylinos.cn \
    /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®