[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221221105202.52a0d793@gandalf.local.home>
Date: Wed, 21 Dec 2022 10:52:02 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Chengming Zhou <zhouchengming@...edance.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com,
vschneid@...hat.com, linux-kernel@...r.kernel.org,
bagasdotme@...il.com, yu.c.chen@...el.com
Subject: Re: [PATCH v5 1/2] sched/core: Minor optimize ttwu_runnable()
On Thu, 8 Dec 2022 11:20:06 +0800
Chengming Zhou <zhouchengming@...edance.com> wrote:
One nit.
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3718,9 +3718,16 @@ static int ttwu_runnable(struct task_struct *p, int wake_flags)
>
> rq = __task_rq_lock(p, &rf);
> if (task_on_rq_queued(p)) {
> - /* check_preempt_curr() may use rq clock */
> - update_rq_clock(rq);
> - ttwu_do_wakeup(rq, p, wake_flags, &rf);
> + if (!task_on_cpu(rq, p)) {
> + /*
> + * When on_rq && !on_cpu the task is preempted, see if
> + * it should preempt whatever is current there now.
* it should preempt the task that is current now.
Other than that.
Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org>
-- Steve
> + */
> + update_rq_clock(rq);
> + check_preempt_curr(rq, p, wake_flags);
> + }
> + WRITE_ONCE(p->__state, TASK_RUNNING);
> + trace_sched_wakeup(p);
> ret = 1;
> }
> __task_rq_unlock(rq, &rf);
Powered by blists - more mailing lists