mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Abel Wu <wuyun.abel@bytedance.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Ingo Molnar <mingo@elte.hu>, Juri Lelli <juri.lelli@redhat.com>
Cc: Yu Chen <yu.c.chen@intel.com>,
	Walter Mack <walter.mack@intel.com>, Mel Gorman <mgorman@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] sched/fair: Simple runqueue order on migrate
Date: Tue, 29 Mar 2022 07:26:05 -0700	[thread overview]
Message-ID: <ebc9718f41b9294fe46129cafe3edffdbcc024e3.camel@linux.intel.com> (raw)
In-Reply-To: <3a24ba8c-b00d-2f9b-95c9-b8aba1b51493@bytedance.com>

On Tue, 2022-03-29 at 18:09 +0800, Abel Wu wrote:
> > 
> 
> >   
> > +static void place_entity_migrate(struct cfs_rq *cfs_rq, struct sched_entity *se)
> > +{
> > +	if (!sched_feat(PLACE_MIGRATE))
> > +		return;
> > +
> > +	if (cfs_rq->nr_running < se->migrated) {
> > +		/*
> > +		 * Migrated to a shorter runqueue, go first because
> > +		 * we were under-served on the old runqueue.
> > +		 */
> > +		se->vruntime = cfs_rq->min_vruntime;
> > +		return;
> > +	}
> > +
> > +	/*
> > +	 * Migrated to a longer runqueue, go last because
> > +	 * we got over-served on the old runqueue.
> > +	 */
> > +	se->vruntime = cfs_rq->min_vruntime + sched_vslice(cfs_rq, se);
> > +}
> 
> Should se->migrated be cleared after place_entity_migrate?
> 

It is cleared in update_stats_curr_start() before we actually run the task.
If the task gets migrated again before we run it, the se->migrated will also
be updated in migrate_task_rq_fair().  Looks like there is no need to
clear it here.

Tim


  reply	other threads:[~2022-03-29 14:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 22:54 [PATCH 0/2] sched/fair: Fix starvation caused by task migration Tim Chen
2022-03-25 22:54 ` [PATCH 1/2] sched/fair: Don't rely on ->exec_start for migration Tim Chen
2022-03-25 22:54 ` [PATCH 2/2] sched/fair: Simple runqueue order on migrate Tim Chen
2022-03-29  9:03   ` Vincent Guittot
2022-03-31 11:47     ` Peter Zijlstra
2022-03-31 12:15       ` Vincent Guittot
2022-03-29 10:09   ` Abel Wu
2022-03-29 14:26     ` Tim Chen [this message]
2022-03-30  9:46   ` [sched/fair] ddb3b1126f: hackbench.throughput -25.9% regression kernel test robot
2022-03-30 23:48     ` Tim Chen
2022-04-01 18:04       ` Chen Yu

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=ebc9718f41b9294fe46129cafe3edffdbcc024e3.camel@linux.intel.com \
    --to=tim.c.chen@linux.intel.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=walter.mack@intel.com \
    --cc=wuyun.abel@bytedance.com \
    --cc=yu.c.chen@intel.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