lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b0a41ce-5fcc-4ea8-83ca-a2bd5ef765c9@amd.com>
Date: Wed, 2 Jul 2025 08:42:57 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Zihuan Zhang <zhangzihuan@...inos.cn>, xuewen.yan@...soc.com,
 vincent.guittot@...aro.org, mingo@...hat.com, peterz@...radead.org,
 juri.lelli@...hat.com
Cc: rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
 vschneid@...hat.com, hongyan.xia2@....com, linux-kernel@...r.kernel.org,
 ke.wang@...soc.com, di.shen@...soc.com, xuewen.yan94@...il.com,
 kuyo.chang@...iatek.com, juju.sung@...iatek.com, qyousef@...alina.io
Subject: Re: [PATCH v1] sched/uclamp: Skip uclamp_rq_dec() for non-final
 dequeue of delayed tasks

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ