From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: vatsa@linux.vnet.ibm.com
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
ckrm-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org,
containers@lists.osdl.org,
"Jan Engelhardt" <jengelh@computergmbh.de>,
"Ingo Molnar" <mingo@elte.hu>,
dhaval@linux.vnet.ibm.com, menage@google.com
Subject: Re: [PATCH] Hookup group-scheduler with task container infrastructure
Date: Wed, 12 Sep 2007 18:25:37 +0200 [thread overview]
Message-ID: <b647ffbd0709120925i690ecb11i975149037fc72979@mail.gmail.com> (raw)
In-Reply-To: <20070912114202.GA30385@linux.vnet.ibm.com>
Hi Srivatsa,
please find a few more minor comments below.
> [ ... ]
> +
> +/* destroy runqueue etc associated with a task group */
> +static void sched_destroy_group(struct container_subsys *ss,
> + struct container *cont)
> +{
> + struct task_grp *tg = container_tg(cont);
> + struct cfs_rq *cfs_rq;
> + struct sched_entity *se;
> + int i;
> +
> + for_each_possible_cpu(i) {
> + cfs_rq = tg->cfs_rq[i];
> + list_del_rcu(&cfs_rq->leaf_cfs_rq_list);
> + }
> +
> + /* wait for possible concurrent references to cfs_rqs complete */
> + synchronize_sched();
> +
> + /* now it should be safe to free those cfs_rqs */
> + for_each_possible_cpu(i) {
> + cfs_rq = tg->cfs_rq[i];
> + kfree(cfs_rq);
> +
> + se = tg->se[i];
> + kfree(se);
> + }
> +
> + kfree(tg);
> +}
kfree(tg->cfs_rq) && kfree(tg->se) ?
> +
> +/* change task's runqueue when it moves between groups */
> +static void sched_move_task(struct container_subsys *ss, struct container *cont,
> + struct container *old_cont, struct task_struct *tsk)
> +{
> + int on_rq, running;
> + unsigned long flags;
> + struct rq *rq;
> +
> + rq = task_rq_lock(tsk, &flags);
> +
> + if (tsk->sched_class != &fair_sched_class)
> + goto done;
this check should be redundant now with sched_can_attach() in place.
> +static void set_se_shares(struct sched_entity *se, unsigned long shares)
> +{
> + struct cfs_rq *cfs_rq = se->cfs_rq;
> + struct rq *rq = cfs_rq->rq;
> + int on_rq;
> +
> + spin_lock_irq(&rq->lock);
> +
> + on_rq = se->on_rq;
> + if (on_rq)
> + __dequeue_entity(cfs_rq, se);
> +
> + se->load.weight = shares;
> + se->load.inv_weight = div64_64((1ULL<<32), shares);
A bit of nit-picking... are you sure, there is no need in non '__'
versions of dequeue/enqueu() here (at least, for the sake of
update_curr())? Although, I don't have -mm at hand at this very moment
and original -rc4 (that I have at hand) doesn't already have
'se->load' at all... so will look later.
>
> --
> Regards,
> vatsa
>
--
Best regards,
Dmitry Adamushko
next prev parent reply other threads:[~2007-09-12 16:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-10 17:10 Srivatsa Vaddagiri
2007-09-10 17:05 ` Jan Engelhardt
2007-09-10 17:23 ` Srivatsa Vaddagiri
2007-09-10 17:22 ` Andrew Morton
2007-09-10 17:41 ` Jan Engelhardt
2007-09-10 17:46 ` Srivatsa Vaddagiri
2007-09-10 22:28 ` Dmitry Adamushko
2007-09-11 4:41 ` Srivatsa Vaddagiri
2007-09-11 9:53 ` Dmitry Adamushko
2007-09-12 11:42 ` Srivatsa Vaddagiri
2007-09-12 12:10 ` Srivatsa Vaddagiri
2007-09-12 16:25 ` Dmitry Adamushko [this message]
2007-09-13 12:33 ` Srivatsa Vaddagiri
2007-09-14 9:41 ` Ingo Molnar
2007-09-14 15:59 ` Srivatsa Vaddagiri
2007-09-14 16:22 ` Srivatsa Vaddagiri
2007-09-10 22:37 ` Dmitry Adamushko
2007-09-10 22:45 ` Paul Menage
2007-09-11 7:20 ` Cedric Le Goater
2007-09-11 15:22 ` Randy Dunlap
2007-09-11 15:37 ` Jan Engelhardt
2007-09-11 15:51 ` Srivatsa Vaddagiri
2007-09-11 15:53 ` Randy Dunlap
2007-09-11 15:44 ` Paul Menage
2007-09-10 17:28 ` Srivatsa Vaddagiri
2007-09-10 17:42 ` Jan Engelhardt
2007-09-10 18:38 ` [Devel] " Paul Menage
2007-09-11 4:44 ` Srivatsa Vaddagiri
2007-09-18 8:19 ` KAMEZAWA Hiroyuki
2007-09-18 10:44 ` Srivatsa Vaddagiri
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=b647ffbd0709120925i690ecb11i975149037fc72979@mail.gmail.com \
--to=dmitry.adamushko@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ckrm-tech@lists.sourceforge.net \
--cc=containers@lists.osdl.org \
--cc=dhaval@linux.vnet.ibm.com \
--cc=jengelh@computergmbh.de \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--cc=vatsa@linux.vnet.ibm.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
all inboxes | Powered by JetHome®