Re: [PATCH v5 2/3] cgroups: add can_attach callback for checking allthreads in a group

From: Paul Menage
Date: Mon Aug 23 2010 - 19:32:07 EST


On Tue, Aug 10, 2010 at 10:48 PM, Ben Blum <bblum@xxxxxxxxxxxxxx> wrote:
>
> Add cgroup wrapper for safely calling can_attach on all threads in a threadgroup
>
> From: Ben Blum <bblum@xxxxxxxxxxxxxx>
>
> This patch adds a function cgroup_can_attach_per_thread which handles iterating
> over each thread in a threadgroup safely with respect to the invariants that
> will be used in cgroup_attach_proc. Also, subsystems whose can_attach calls
> require per-thread validation are modified to use the per_thread wrapper to
> avoid duplicating cgroup-internal code.
>
> This is a pre-patch for cgroup-procs-writable.patch.
>
> Signed-off-by: Ben Blum <bblum@xxxxxxxxxxxxxx>

Acked-by: Paul Menage <menage@xxxxxxxxxx>

Some of the can_attach() methods could be simplified slightly by
directly returning the result of cgroup_can_attach_per_thread()

Paul
--
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/