From: Mike Galbraith <efault@gmx.de>
To: Dima Zavin <dima@android.com>
Cc: linux-kernel@vger.kernel.org,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"Ingo Molnar" <mingo@elte.hu>,
"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH 1/2] sched: normalize sleeper's vruntime during group change
Date: Wed, 29 Sep 2010 10:13:15 +0200 [thread overview]
Message-ID: <1285747995.7844.42.camel@marge.simson.net> (raw)
In-Reply-To: <1285742774-5013-1-git-send-email-dima@android.com>
On Tue, 2010-09-28 at 23:46 -0700, Dima Zavin wrote:
> This adds a new callback, prep_move_task, to struct sched_class
> to give sched_fair the opportunity to adjust the task's vruntime
> just before setting its new group.
>
> This allows us to properly normalize a sleeping task's vruntime
> when moving it between different cgroups.
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index db3f674..008fe57 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -3827,10 +3827,23 @@ static void set_curr_task_fair(struct rq *rq)
> static void moved_group_fair(struct task_struct *p, int on_rq)
> {
> struct cfs_rq *cfs_rq = task_cfs_rq(p);
> + struct sched_entity *se = &p->se;
>
> update_curr(cfs_rq);
> - if (!on_rq)
> + if (!on_rq) {
> + se->vruntime += cfs_rq->min_vruntime;
> place_entity(cfs_rq, &p->se, 1);
> + }
> +}
I'm still missing the place_entity() rationale. Why is a sleeping task
eligible for pain therapy that a runnable task is spared? That state
can change a usec from now.
Nit: place_entity(cfs_rq, se, 1);
-Mike
next prev parent reply other threads:[~2010-09-29 8:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-29 6:46 [PATCH 1/2] sched: normalize sleeper's vruntime during group change Dima Zavin
2010-09-29 6:46 ` [PATCH 2/2] sched: use the old min_vruntime when normalizing on dequeue Dima Zavin
2010-10-07 21:00 ` Dima Zavin
2010-10-08 6:57 ` Mike Galbraith
2010-09-29 6:54 ` [PATCH 1/2] sched: normalize sleeper's vruntime during group change Pekka Enberg
2010-09-29 7:17 ` Dima Zavin
2010-09-29 8:13 ` Mike Galbraith [this message]
2010-09-29 19:02 ` Dima Zavin
2010-09-29 21:44 ` Dima Zavin
2010-09-30 10:47 ` Peter Zijlstra
2010-09-30 19:14 ` Dima Zavin
2010-10-01 11:59 ` Peter Zijlstra
2010-10-04 19:18 ` Dima Zavin
2010-10-06 22:56 ` Dima Zavin
2010-10-07 2:24 ` Mike Galbraith
2010-10-15 13:50 ` Peter Zijlstra
2010-10-22 13:02 ` [tip:sched/urgent] sched, cgroup: Fixup broken cgroup movement tip-bot for Peter Zijlstra
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=1285747995.7844.42.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=a.p.zijlstra@chello.nl \
--cc=arve@android.com \
--cc=dima@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.