Re: [PATCHSET] cgroup: introduce cgroup_taskset and consolidatesubsys methods

From: Frederic Weisbecker
Date: Tue Aug 23 2011 - 21:14:41 EST


On Wed, Aug 24, 2011 at 12:19:54AM +0200, Tejun Heo wrote:
> Hello,
>
> cgroup has grown quite some number of subsys methods. Some of them
> are overlapping, inconsistent with each other and called under
> different conditions depending on whether they're called for a single
> task or whole process. Unfortunately, these callbacks are complicated
> and incomplete at the same time.
>
> * ->attach_task() is called after migration for task attach but before
> for process.
>
> * Ditto for ->pre_attach().
>
> * ->can_attach_task() is called for every task in the thread group but
> ->attach_task() skips the ones which don't actually change cgroups.
>
> * Task attach becomes noop if the task isn't actually moving. Process
> attach is always performed.
>
> * ->attach_task() doesn't (or at least aren't supposed to) have access
> to the old cgroup.
>
> * During cancel, there's no way to access the affected tasks.
>
> This patchset introduces cgroup_taskset along with some accessors and
> iterator, updates methods to use it, consolidates usages and drops
> superflous methods.
>
> It contains the following six patches.
>
> 0001-cgroup-subsys-attach_task-should-be-called-after-mig.patch
> 0002-cgroup-improve-old-cgroup-handling-in-cgroup_attach_.patch
> 0003-cgroup-introduce-cgroup_taskset-and-use-it-in-subsys.patch
> 0004-cgroup-don-t-use-subsys-can_attach_task-or-attach_ta.patch
> 0005-cgroup-cpuset-don-t-use-ss-pre_attach.patch
> 0006-cgroup-kill-subsys-can_attach_task-pre_attach-and-at.patch

I don't understand the point on patches 3,4,5,6

Why pushing the task iterations down to the subsystems?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/