[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421082832.GD9721@chenyu-office.sh.intel.com>
Date: Tue, 21 Apr 2020 16:28:32 +0800
From: Chen Yu <yu.c.chen@...el.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>
Subject: Re: [PATCH 2/2] sched: Extract the task putting code from
pick_next_task()
On Mon, Apr 20, 2020 at 06:32:32PM -0400, Steven Rostedt wrote:
> On Mon, 20 Apr 2020 00:31:52 +0800
> Chen Yu <yu.c.chen@...el.com> wrote:
>
> > Introduce a new function finish_prev_task() to do the balance
> > when necessary, and then put previous task back to the run queue.
> > This function is extracted from pick_next_task() to prepare for
> > future usage by other type of task picking logic.
> >
> > No functional change.
> >
> > Suggested-by: Peter Zijlstra <peterz@...radead.org>
> > Signed-off-by: Chen Yu <yu.c.chen@...el.com>
> > ---
> > kernel/sched/core.c | 39 +++++++++++++++++++++++----------------
> > 1 file changed, 23 insertions(+), 16 deletions(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 3a61a3b8eaa9..bf59a5cf030c 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -3904,6 +3904,28 @@ static inline void schedule_debug(struct task_struct *prev, bool preempt)
> > schedstat_inc(this_rq()->sched_count);
> > }
> >
> > +static void finish_prev_task(struct rq *rq, struct task_struct *prev,
> > + struct rq_flags *rf)
> > +{
> > + const struct sched_class *class;
> > +#ifdef CONFIG_SMP
> > + /*
> > + * We must do the balancing pass before put_next_task(), such
>
> I know this is just a cut and paste move, but I'm thinking that this
> comment is wrong. Shouldn't this be "put_prev_task()" as we have no
> "put_next_task()" function.
>
>
Okay, I'll fix it in v3.
> > + finish_prev_task(rq, prev, rf);
>
> I'm not sure I like the name of this function. Perhaps
> "balance_and_put_prev_task()"? Something more in kind to what the function
> does.
>
Per the discussion, I think put_prev_task_balance() might be an
appropriate one.
Thanks,
Chenyu
> -- Steve
>
> >
> > for_each_class(class) {
> > p = class->pick_next_task(rq);
>
Powered by blists - more mailing lists