From: Peter Zijlstra <peterz@infradead.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/preempt: Bypass setting same mode for sched_dynamic_update()
Date: Thu, 20 Jun 2024 14:33:38 +0200 [thread overview]
Message-ID: <20240620123338.GX31592@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20240620121020.869707-1-ruanjinjie@huawei.com>
On Thu, Jun 20, 2024 at 08:10:20PM +0800, Jinjie Ruan wrote:
> If the preempt mode to set is same with current preempt mode, there is no
> need to update all the `cond_resched`, `might_resched`, `preempt_schedule`,
> `preempt_schedule_notrace` and `irqentry_exit_cond_resched` state.
IIRC this actively breaks things, also this is a super slow path, nobody
should care.
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> kernel/sched/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index bcf2c4cc0522..eb409901c64c 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8777,6 +8777,9 @@ static bool klp_override;
>
> static void __sched_dynamic_update(int mode)
> {
> + if (mode == preempt_dynamic_mode)
> + return;
> +
> /*
> * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in
> * the ZERO state, which is invalid.
> --
> 2.34.1
>
prev parent reply other threads:[~2024-06-20 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 12:10 Jinjie Ruan
2024-06-20 12:33 ` Peter Zijlstra [this message]
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=20240620123338.GX31592@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=ruanjinjie@huawei.com \
--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
Powered by JetHome