[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110826024822.GA1919@count0.beaverton.ibm.com>
Date: Thu, 25 Aug 2011 19:48:22 -0700
From: Matt Helsley <matthltc@...ibm.com>
To: Matt Helsley <matthltc@...ibm.com>
Cc: Tejun Heo <tj@...nel.org>, rjw@...k.pl, paul@...lmenage.org,
lizf@...fujitsu.com, linux-pm@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org, fweisbec@...il.com,
kamezawa.hiroyu@...fujitsu.com,
Balbir Singh <bsingharora@...il.com>,
Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
James Morris <jmorris@...ei.org>
Subject: Re: [PATCH 3/6] cgroup: introduce cgroup_taskset and use it in
subsys->can_attach(), cancel_attach() and attach()
On Thu, Aug 25, 2011 at 07:38:18PM -0700, Matt Helsley wrote:
> On Fri, Aug 26, 2011 at 12:43:09AM +0200, Tejun Heo wrote:
> > Currently, there's no way to pass multiple tasks to cgroup_subsys
> > methods necessitating the need for separate per-process and per-task
> > methods. This patch introduces cgroup_taskset which can be used to
> > pass multiple tasks and their associated cgroups to cgroup_subsys
> > methods.
>
> This will be the third iterator-ish pattern in the cgroup code.
> It's not your fault but it does seem a bit much to have:
>
> 1) When we need to iterate over all tasks in the cgroup and
> don't mind holding the css set lock:
> void cgroup_iter_start(cgroup, iterator)
> task cgroup_iter_next(cgroup, iterator)
> void cgroup_iter_end(cgroup, iterator)
>
> 2) For subsystem methods when we're iterating over a subset of
> tasks that may or may not be in the cgroup (e.g. for can_attach)
> -- use cgroup_tasksets:
> task cgroup_taskset_first(tset)
> task cgroup_taskset_next(tset)
>
> 3) An iterator over all the tasks which doesn't hold the css set
> lock:
> struct cgroup_scanner {
> struct cgroup *cg;
> int (*test_task)(struct task_struct *p,
> struct cgroup_scanner *scan);
> void (*process_task)(struct task_struct *p,
> struct cgroup_scanner *scan);
> struct ptr_heap *heap;
> void *data;
> };
> This is only used in cpuset code so far. Are other cgroup
> patches planning on making use of it?
>
> Is there a sane way to merge all this?
>
> Perhaps we could drop the iterator interfaces in 1) and 2) and replace
Oops! I meant to suggest dropping interfaces 1) and 3).
Cheers,
-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists