From: Peter Zijlstra <peterz@infradead.org>
To: Miaohe Lin <linmiaohe@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/deadline: Use helper function task_current()
Date: Sat, 17 Jun 2023 14:26:22 +0200 [thread overview]
Message-ID: <20230617122622.GC1830050@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230617074305.1916633-1-linmiaohe@huawei.com>
On Sat, Jun 17, 2023 at 03:43:05PM +0800, Miaohe Lin wrote:
> Use helper function task_current() to check whether task is currently
> running on the runqueue. No functional change intended.
Why though? this makes no sense. Please leave perfectly fine code alone.
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> kernel/sched/deadline.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index f827067ad03b..23284229e16b 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2424,7 +2424,7 @@ static void pull_dl_task(struct rq *this_rq)
> */
> if (p && dl_time_before(p->dl.deadline, dmin) &&
> dl_task_is_earliest_deadline(p, this_rq)) {
> - WARN_ON(p == src_rq->curr);
> + WARN_ON(task_current(src_rq, p));
> WARN_ON(!task_on_rq_queued(p));
>
> /*
> @@ -2636,7 +2636,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p)
> return;
> }
>
> - if (rq->curr != p) {
> + if (!task_current(rq, p)) {
> #ifdef CONFIG_SMP
> if (p->nr_cpus_allowed > 1 && rq->dl.overloaded)
> deadline_queue_push_tasks(rq);
> --
> 2.27.0
>
next prev parent reply other threads:[~2023-06-17 12:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-17 7:43 Miaohe Lin
2023-06-17 12:26 ` Peter Zijlstra [this message]
2023-06-19 1:49 ` Miaohe Lin
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=20230617122622.GC1830050@hirez.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=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--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
all inboxes | Powered by JetHome®