public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Byungchul Park <byungchul.park@lge.com>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, yuyang.du@intel.com
Subject: Re: [PATCH v4 5/5] sched: add two functions for att(det)aching a task to(from) a cfs_rq
Date: Tue, 1 Sep 2015 17:03:43 +0200	[thread overview]
Message-ID: <20150901150343.GT19282@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20150901002849.GA30881@byungchulpark-X58A-UD3R>

On Tue, Sep 01, 2015 at 09:28:49AM +0900, Byungchul Park wrote:

> check the condition "!(flags & DEQUEUE_SLEEP)" for doing normalizing in
> dequeue_entity(). i think you have to keep my original comment, or
> modify your comment to something like below.
> 
> before - If it's !queued, sleeping tasks have a normalized vruntime,
> after - If it's !queued, sleeping tasks have a non-normalize vruntime,
> 
> but.. i think it would be better that you keep my original comment..

The comment we can talk about later, but I think the condition:

> > -	if (p->state == TASK_RUNNING)
> > +	if (!p->se.on_rq)

is important now. Both are broken in different ways.

	p->state == TASK_RUNNING

is broken in this scenario:

	CPU0					CPU1

	set_current_state(TASK_UNINTERRUPTIBLE);

						sched_move_task()
						  task_move_group_fair()
						    vruntime_normalized() == true
	if (!cond)
		schedule();
	__set_current_state(TASK_RUNNING);


Now the proposed replacement:

	!p->se.on_rq

is equally broken, because (as you point out) clearing it isn't
conditional on DEQUEUE_SLEEP.


And the problem with tracking the vruntime state is that while it helps
detach_task_cfs_rq(), attach_task_cfs_rq() is still left wondering what
it should return to.

So we do indeed need something to determine, based on the current state,
if vruntime should be normalized.

/me ponders moar

  parent reply	other threads:[~2015-09-01 15:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20 11:21 [PATCH v4 0/5] sync a se with its cfs_rq when att(det)aching it byungchul.park
2015-08-20 11:21 ` [PATCH v4 1/5] sched: add two functions adjusting cfs_rq's load when att(det)aching a se byungchul.park
2015-09-13 10:58   ` [tip:sched/core] sched/fair: Factor out the {at, de}taching of the per entity load {to,from} the runqueue tip-bot for Byungchul Park
2015-08-20 11:21 ` [PATCH v4 2/5] sched: make task_move_group_fair adjust cfs_rq's load in case of queued byungchul.park
2015-09-13 10:59   ` [tip:sched/core] sched/fair: Have task_move_group_fair() unconditionally add the entity load to the runqueue tip-bot for Byungchul Park
2015-08-20 11:21 ` [PATCH v4 3/5] sched: sync a se with prev cfs_rq when changing cgroup byungchul.park
2015-09-13 10:59   ` [tip:sched/core] sched/fair: Have task_move_group_fair() also detach entity load from the old runqueue tip-bot for Byungchul Park
2015-08-20 11:21 ` [PATCH v4 4/5] sched: sync a se with its cfs_rq when switching sched class to fair class byungchul.park
2015-09-13 10:59   ` [tip:sched/core] sched/fair: Fix switched_to_fair()' s per entity load tracking tip-bot for Byungchul Park
2015-08-20 11:22 ` [PATCH v4 5/5] sched: add two functions for att(det)aching a task to(from) a cfs_rq byungchul.park
2015-08-20 11:35   ` Byungchul Park
2015-08-31 15:21     ` Peter Zijlstra
2015-08-31 15:37       ` Peter Zijlstra
2015-09-01  0:28       ` Byungchul Park
2015-09-01  2:59         ` Byungchul Park
2015-09-01 15:03         ` Peter Zijlstra [this message]
2015-09-02  2:33           ` Byungchul Park
2015-09-02  8:14             ` Peter Zijlstra
2015-09-02  8:29               ` Ingo Molnar
2015-09-13 11:00   ` [tip:sched/core] sched/fair: Unify switched_{from,to}_fair() and task_move_group_fair() tip-bot for Byungchul Park
2015-08-22  7:45 ` [PATCH v4 0/5] sync a se with its cfs_rq when att(det)aching it Byungchul Park
2015-08-25 23:54 ` Byungchul Park

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=20150901150343.GT19282@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=byungchul.park@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=yuyang.du@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