From: Christian Loehle <christian.loehle@arm.com>
To: Xuewen Yan <xuewen.yan@unisoc.com>,
vincent.guittot@linaro.org, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com
Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
hongyan.xia2@arm.com, ke.wang@unisoc.com, di.shen@unisoc.com,
xuewen.yan94@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] sched/uclamp: Always using uclamp_is_used()
Date: Wed, 19 Feb 2025 15:57:19 +0000 [thread overview]
Message-ID: <ae526670-5a3d-4c86-991b-3c3175f6d03d@arm.com> (raw)
In-Reply-To: <20250219093747.2612-1-xuewen.yan@unisoc.com>
On 2/19/25 09:37, Xuewen Yan wrote:
> Now, we have the uclamp_is_used() func to judge the uclamp enabled,
> so replace the static_branch_unlikely(&sched_uclamp_used) with it.
>
> Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
> Reviewed-by: Hongyan Xia <hongyan.xia2@arm.com>
> Reviewed-by: Christian Loehle <christian.loehle@arm.com>
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> V2:
> - Correct the spelling mistakes in the commit message (Hongyan)
> - Add Reviewed-by
> ---
> ---
> kernel/sched/core.c | 4 ++--
> kernel/sched/sched.h | 28 ++++++++++++++--------------
> 2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 9aecd914ac69..38a7192bfc19 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1757,7 +1757,7 @@ static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p)
> * The condition is constructed such that a NOP is generated when
> * sched_uclamp_used is disabled.
> */
> - if (!static_branch_unlikely(&sched_uclamp_used))
> + if (!uclamp_is_used())
> return;
>
> if (unlikely(!p->sched_class->uclamp_enabled))
> @@ -1784,7 +1784,7 @@ static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p)
> * The condition is constructed such that a NOP is generated when
> * sched_uclamp_used is disabled.
> */
> - if (!static_branch_unlikely(&sched_uclamp_used))
> + if (!uclamp_is_used())
> return;
v2 includes the above two which inverse the likely annotation FYI.
next prev parent reply other threads:[~2025-02-19 15:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 9:37 Xuewen Yan
2025-02-19 9:37 ` [PATCH v2 2/2] sched/uclamp: Add uclamp_is_used() check before enable it Xuewen Yan
2025-02-19 15:59 ` Christian Loehle
2025-02-19 16:25 ` Vincent Guittot
2025-03-14 20:24 ` [tip: sched/core] " tip-bot2 for Xuewen Yan
2025-03-15 9:37 ` [tip: sched/core] sched/uclamp: Optimize sched_uclamp_used static key enabling tip-bot2 for Xuewen Yan
2025-02-19 15:57 ` Christian Loehle [this message]
2025-03-14 20:24 ` [tip: sched/core] sched/uclamp: Always using uclamp_is_used() tip-bot2 for Xuewen Yan
2025-03-15 9:37 ` [tip: sched/core] sched/uclamp: Use the uclamp_is_used() helper instead of open-coding it tip-bot2 for Xuewen Yan
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=ae526670-5a3d-4c86-991b-3c3175f6d03d@arm.com \
--to=christian.loehle@arm.com \
--cc=bsegall@google.com \
--cc=di.shen@unisoc.com \
--cc=dietmar.eggemann@arm.com \
--cc=hongyan.xia2@arm.com \
--cc=juri.lelli@redhat.com \
--cc=ke.wang@unisoc.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 \
--cc=xuewen.yan94@gmail.com \
--cc=xuewen.yan@unisoc.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®