[Devel] [PATCH v8 4/3] cgroups: use flex_array in attach_proc

2011-02-17 Thread Ben Blum
Convert cgroup_attach_proc to use flex_array. From: Ben Blum bb...@andrew.cmu.edu The cgroup_attach_proc implementation requires a pre-allocated array to store task pointers to atomically move a thread-group, but asking for a monolithic array with kmalloc() may be unreliable for very large

[Devel] Re: [PATCH v8 0/3] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2011-02-09 Thread Ben Blum
On Thu, Feb 10, 2011 at 10:02:10AM +0900, KAMEZAWA Hiroyuki wrote: On Wed, 9 Feb 2011 15:10:46 -0800 Andrew Morton a...@linux-foundation.org wrote: On Mon, 7 Feb 2011 20:35:42 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Sun, Dec 26, 2010 at 07:09:19AM -0500, Ben Blum wrote

[Devel] [PATCH v8 0/3] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2011-02-07 Thread Ben Blum
On Sun, Dec 26, 2010 at 07:09:19AM -0500, Ben Blum wrote: On Fri, Dec 24, 2010 at 03:22:26AM -0500, Ben Blum wrote: On Wed, Aug 11, 2010 at 01:46:04AM -0400, Ben Blum wrote: On Fri, Jul 30, 2010 at 07:56:49PM -0400, Ben Blum wrote: This patch series is a revision of http://lkml.org/lkml

[Devel] [PATCH v8 1/3] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2011-02-07 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [PATCH v8 2/3] cgroups: add per-thread subsystem callbacks

2011-02-07 Thread Ben Blum
Add cgroup subsystem callbacks for per-thread attachment From: Ben Blum bb...@andrew.cmu.edu This patch adds can_attach_task, pre_attach, and attach_task as new callbacks for cgroups's subsystem interface. Unlike can_attach and attach, these are for per-thread operations, to be called

[Devel] [PATCH v8 3/3] cgroups: make procs file writable

2011-02-07 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [PATCH v7 1/3] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2011-02-04 Thread Ben Blum
On Mon, Jan 24, 2011 at 01:05:29PM -0800, Andrew Morton wrote: On Sun, 26 Dec 2010 07:09:51 -0500 Ben Blum bb...@andrew.cmu.edu wrote: Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem

[Devel] Re: [PATCH v7 1/3] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2011-02-04 Thread Ben Blum
On Fri, Feb 04, 2011 at 01:36:57PM -0800, Andrew Morton wrote: On Fri, 4 Feb 2011 16:25:15 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Mon, Jan 24, 2011 at 01:05:29PM -0800, Andrew Morton wrote: On Sun, 26 Dec 2010 07:09:51 -0500 Ben Blum bb...@andrew.cmu.edu wrote: Adds

[Devel] Re: [PATCH v7 2/3] cgroups: add atomic-context per-thread subsystem callbacks

2011-01-24 Thread Ben Blum
On Mon, Jan 24, 2011 at 12:38:06AM -0800, Paul Menage wrote: Hi Ben, Finally finding a moment to actually look at these patches. Sorry it's been a while. Can you send the patches inline rather than as attachments in future? Whoops, sure thing. Reviewed-by: Paul Menage men...@google.com

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-27 Thread Ben Blum
On Mon, Dec 27, 2010 at 04:42:07PM +0900, KAMEZAWA Hiroyuki wrote: On Mon, 27 Dec 2010 02:21:23 -0500 Ben Blum bb...@andrew.cmu.edu wrote: IIUC, what you request is 'don't call any kind of function may sleep'. in can_attach() and attach() callback. That's impossible. Memory cgroup

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-27 Thread Ben Blum
On Mon, Dec 27, 2010 at 06:18:01PM +0900, KAMEZAWA Hiroyuki wrote: On Mon, 27 Dec 2010 03:42:57 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Mon, Dec 27, 2010 at 04:42:07PM +0900, KAMEZAWA Hiroyuki wrote: Okay, then, problem is cpuset, which allocates memory. (But I feel

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-27 Thread Ben Blum
On Mon, Dec 27, 2010 at 02:31:21AM -0800, David Rientjes wrote: On Sun, 26 Dec 2010, Ben Blum wrote: I was going to make a macro like NODEMASK_STATIC, but it turned out that can_attach() needed the to/from nodemasks to be shared among three functions for the attaching, so I defined them

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-27 Thread Ben Blum
On Mon, Dec 27, 2010 at 02:53:47AM -0800, David Rientjes wrote: On Mon, 27 Dec 2010, Ben Blum wrote: I'm not sure what the benefit of defining it as a macro would be. You're defining these statically allocated nodemasks so they have file scope, I hope (so they can be shared amongst

[Devel] [PATCH v7 0/3] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-12-26 Thread Ben Blum
On Fri, Dec 24, 2010 at 03:22:26AM -0500, Ben Blum wrote: On Wed, Aug 11, 2010 at 01:46:04AM -0400, Ben Blum wrote: On Fri, Jul 30, 2010 at 07:56:49PM -0400, Ben Blum wrote: This patch series is a revision of http://lkml.org/lkml/2010/6/25/11 . This patch series implements a write

[Devel] [PATCH v7 1/3] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-12-26 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [PATCH v7 2/3] cgroups: add atomic-context per-thread subsystem callbacks

2010-12-26 Thread Ben Blum
Add cgroup subsystem callbacks for per-thread attachment in atomic contexts From: Ben Blum bb...@andrew.cmu.edu This patch adds can_attach_task, pre_attach, and attach_task as new callbacks for cgroups's subsystem interface. Unlike can_attach and attach, these are for per-thread operations

[Devel] [PATCH v7 3/3] cgroups: make procs file writable

2010-12-26 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-26 Thread Ben Blum
On Sun, Dec 26, 2010 at 01:48:58PM -0800, David Rientjes wrote: On Fri, 24 Dec 2010, Ben Blum wrote: I'll add a patch to my current series to do this. Should I leave alone the other cases where an out-of-memory causes a silent failure? (cpuset_change_nodemask, scan_for_empty_cpusets

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-26 Thread Ben Blum
On Mon, Dec 27, 2010 at 09:53:53AM +0900, Daisuke Nishimura wrote: On Fri, 24 Dec 2010 21:55:08 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Thu, Dec 23, 2010 at 10:33:52PM -0500, Ben Blum wrote: On Thu, Dec 16, 2010 at 12:26:03AM -0800, Andrew Morton wrote: Patches have gone a bit

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-26 Thread Ben Blum
On Mon, Dec 27, 2010 at 04:00:41PM +0900, KAMEZAWA Hiroyuki wrote: On Sun, 26 Dec 2010 23:22:54 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Mon, Dec 27, 2010 at 09:53:53AM +0900, Daisuke Nishimura wrote: On Fri, 24 Dec 2010 21:55:08 -0500 Ben Blum bb...@andrew.cmu.edu wrote

[Devel] [PATCH v6 0/3] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-12-24 Thread Ben Blum
On Wed, Aug 11, 2010 at 01:46:04AM -0400, Ben Blum wrote: On Fri, Jul 30, 2010 at 07:56:49PM -0400, Ben Blum wrote: This patch series is a revision of http://lkml.org/lkml/2010/6/25/11 . This patch series implements a write function for the 'cgroup.procs' per-cgroup file, which enables

[Devel] [PATCH v6 2/3] cgroups: add can_attach callback for checking all threads in a group

2010-12-24 Thread Ben Blum
Add cgroup wrapper for safely calling can_attach on all threads in a threadgroup From: Ben Blum bb...@andrew.cmu.edu 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

[Devel] [PATCH v6 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Fri, Dec 24, 2010 at 02:49:43AM -0800, David Rientjes wrote: On Thu, 23 Dec 2010, Ben Blum wrote: On Thu, Dec 16, 2010 at 12:26:03AM -0800, Andrew Morton wrote: Patches have gone a bit stale, sorry. Refactoring in kernel/cgroup_freezer.c necessitates a refresh and retest please

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Fri, Dec 24, 2010 at 03:53:31AM -0800, Andrew Morton wrote: On Fri, 24 Dec 2010 06:45:00 -0500 Ben Blum bb...@andrew.cmu.edu wrote: kmalloc() is allowed while holding a spinlock and NODEMASK_ALLOC() takes a gfp_flags argument for that reason. Ah, it's only with GFP_KERNEL

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Fri, Dec 24, 2010 at 07:08:53AM -0500, Ben Blum wrote: On Fri, Dec 24, 2010 at 03:53:31AM -0800, Andrew Morton wrote: On Fri, 24 Dec 2010 06:45:00 -0500 Ben Blum bb...@andrew.cmu.edu wrote: kmalloc() is allowed while holding a spinlock and NODEMASK_ALLOC() takes a gfp_flags

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Fri, Dec 24, 2010 at 01:34:06PM -0800, David Rientjes wrote: On Fri, 24 Dec 2010, Ben Blum wrote: Oh, also, most (not all) times that NODEMASK_ALLOC is used in cpusets, cgroup_mutex is also held. So how about just using static storage for them? (There could be a new macro

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Thu, Dec 23, 2010 at 10:33:52PM -0500, Ben Blum wrote: On Thu, Dec 16, 2010 at 12:26:03AM -0800, Andrew Morton wrote: Patches have gone a bit stale, sorry. Refactoring in kernel/cgroup_freezer.c necessitates a refresh and retest please. commit 53feb29767c29c877f9d47dcfe14211b5b0f7ebd

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-24 Thread Ben Blum
On Thu, Dec 23, 2010 at 10:33:52PM -0500, Ben Blum wrote: On Thu, Dec 16, 2010 at 12:26:03AM -0800, Andrew Morton wrote: Patches have gone a bit stale, sorry. Refactoring in kernel/cgroup_freezer.c necessitates a refresh and retest please. commit 53feb29767c29c877f9d47dcfe14211b5b0f7ebd

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-23 Thread Ben Blum
On Thu, Dec 16, 2010 at 12:26:03AM -0800, Andrew Morton wrote: Patches have gone a bit stale, sorry. Refactoring in kernel/cgroup_freezer.c necessitates a refresh and retest please. commit 53feb29767c29c877f9d47dcfe14211b5b0f7ebd changed a bunch of stuff in kernel/cpuset.c to allocate

[Devel] [PATCH v5 0/3] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-08-10 Thread Ben Blum
On Fri, Jul 30, 2010 at 07:56:49PM -0400, Ben Blum wrote: This patch series is a revision of http://lkml.org/lkml/2010/6/25/11 . This patch series implements a write function for the 'cgroup.procs' per-cgroup file, which enables atomic movement of multithreaded applications between cgroups

[Devel] [PATCH v5 1/3] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-08-10 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [PATCH v5 2/3] cgroups: add can_attach callback for checking all threads in a group

2010-08-10 Thread Ben Blum
Add cgroup wrapper for safely calling can_attach on all threads in a threadgroup From: Ben Blum bb...@andrew.cmu.edu 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

[Devel] [PATCH v5 3/3] cgroups: make procs file writable

2010-08-10 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [PATCH v4 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-08-06 Thread Ben Blum
On Tue, Aug 03, 2010 at 09:34:22PM -0700, Paul Menage wrote: On Tue, Aug 3, 2010 at 9:33 PM, Ben Blum bb...@andrew.cmu.edu wrote: As far as the #ifdef mess goes, it's true that some people don't have CONFIG_CGROUPS defined. I'd imagine that these are likely to be embedded systems

[Devel] Re: [PATCH v4 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-08-03 Thread Ben Blum
On Tue, Aug 03, 2010 at 08:44:01PM -0700, Paul Menage wrote: On Fri, Jul 30, 2010 at 4:57 PM, Ben Blum bb...@andrew.cmu.edu wrote: +* The threadgroup_fork_lock prevents threads from forking with +* CLONE_THREAD while held for writing. Use this for fork-sensitive +* threadgroup

[Devel] Re: [PATCH v4 2/2] cgroups: make procs file writable

2010-08-03 Thread Ben Blum
On Tue, Aug 03, 2010 at 09:30:00PM -0700, Paul Menage wrote: --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1404,6 +1404,10 @@ static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cont, ? ? ? ? ? ? ? struct task_struct *c; ? ? ? ? ? ? ? rcu_read_lock(); + ? ? ? ?

[Devel] [PATCH v4 0/2] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-07-30 Thread Ben Blum
This patch series is a revision of http://lkml.org/lkml/2010/6/25/11 . This patch series implements a write function for the 'cgroup.procs' per-cgroup file, which enables atomic movement of multithreaded applications between cgroups. Writing the thread-ID of any thread in a threadgroup to a

[Devel] [PATCH v4 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-07-30 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [PATCH v4 2/2] cgroups: make procs file writable

2010-07-30 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [RFC] [PATCH v3 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-07-28 Thread Ben Blum
On Mon, Jun 28, 2010 at 11:43:59AM -0400, Ben Blum wrote: On Mon, Jun 28, 2010 at 04:10:31PM +0900, KAMEZAWA Hiroyuki wrote: By the way, IMHO, hiding lock in cgroup_fork() and cgroup_post_fork() doesn't seem good idea. How about a code like this ? read_lock_thread_clone(current

[Devel] Re: [RFC] [PATCH v3 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-07-28 Thread Ben Blum
On Wed, Jul 28, 2010 at 06:28:13PM +0900, KAMEZAWA Hiroyuki wrote: On Wed, 28 Jul 2010 04:29:53 -0400 Ben Blum bb...@andrew.cmu.edu wrote: On Mon, Jun 28, 2010 at 11:43:59AM -0400, Ben Blum wrote: On Mon, Jun 28, 2010 at 04:10:31PM +0900, KAMEZAWA Hiroyuki wrote: By the way, IMHO

[Devel] Re: [RFC] [PATCH v3 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-06-28 Thread Ben Blum
On Mon, Jun 28, 2010 at 04:10:31PM +0900, KAMEZAWA Hiroyuki wrote: On Fri, 25 Jun 2010 01:46:54 -0400 Ben Blum bb...@andrew.cmu.edu wrote: Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem

[Devel] [RFC] [PATCH v3 0/2] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-06-24 Thread Ben Blum
This patch series is a revision of http://lkml.org/lkml/2010/5/29/126 . These patches use an rwlock in signal_struct which access is dependent on Oleg's recent changes to signal_struct's lifetime rules. It is okay to write the tid of any task in the threadgroup. This is implemented by taking

[Devel] [RFC] [PATCH v3 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-06-24 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [RFC] [PATCH v3 2/2] cgroups: make procs file writable

2010-06-24 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [RFC] [PATCH 2/2] cgroups: make procs file writable

2010-06-02 Thread Ben Blum
On Wed, Jun 02, 2010 at 10:58:55PM +0200, Oleg Nesterov wrote: Hmm. The usage of -thread_group in -can_attach() methods doesn't look safe to me... but currently bool threadgroup is always false. Oleg. I recall putting a rcu_read_lock() around that part and being assured that made it

[Devel] Re: [RFC] [PATCH 2/2] cgroups: make procs file writable

2010-06-02 Thread Ben Blum
On Wed, Jun 02, 2010 at 03:03:49PM -0700, Paul Menage wrote: On Wed, Jun 2, 2010 at 2:38 PM, Oleg Nesterov o...@redhat.com wrote: cgroup_attach_task() does, and this time PF_EXITING is understandable. Oh, OK, I was talking about the one in cgroup_attach_task(), which is called by

[Devel] Re: [RFC] [PATCH 2/2] cgroups: make procs file writable

2010-06-02 Thread Ben Blum
On Mon, May 31, 2010 at 07:52:42PM +0200, Oleg Nesterov wrote: I only glanced into one function, cgroup_attach_proc(), and some things look obviously wrong. Sorry, I can't really read these patches now, most probably I misunderstood the code... +int cgroup_attach_proc(struct cgroup *cgrp,

[Devel] [RFC] [PATCH v2 0/2] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-05-29 Thread Ben Blum
This patch series is a revision of http://lkml.org/lkml/2010/1/3/51 and http://lkml.org/lkml/2010/1/3/52 . The rwsem in the fork path has been moved to signal_struct to simplify the locking code in the cgroup_attach_proc side. This depends on Oleg's recentish changes to signal_struct's lifetime

[Devel] [RFC] [PATCH 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-05-29 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's signal_struct that's taken for reading in the fork path, under CONFIG_CGROUPS. If another part of the kernel later wants to use

[Devel] [RFC] [PATCH 2/2] cgroups: make procs file writable

2010-05-29 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] Re: [PATCH] block: make CONFIG_BLK_CGROUP visible

2010-03-14 Thread Ben Blum
help depends on BLK_CGROUP default n ---help--- -- 1.6.3 LGTM. Acked-by: Ben Blum bb...@andrew.cmu.edu ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo

[Devel] Re: [RFC] [PATCH 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-01-17 Thread Ben Blum
On Tue, Jan 05, 2010 at 07:53:30PM +0100, Oleg Nesterov wrote: On 01/03, Ben Blum wrote: Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup I didn't actually read this series, but at first glance it still has problems... +struct sighand_struct

[Devel] Re: [RFC] [PATCH 2/2] cgroups: blkio subsystem as module

2010-01-12 Thread Ben Blum
On Fri, Jan 08, 2010 at 11:33:52AM -0500, Vivek Goyal wrote: On Fri, Jan 08, 2010 at 12:30:21AM -0500, Ben Blum wrote: Convert blk-cgroup to be buildable as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies the Block I/O cgroup subsystem to be able to be built

[Devel] [PATCH v2 1/2] cgroups: modular subsystems support for use_id

2010-01-12 Thread Ben Blum
This patch adds support for subsys.use_id in module-loadable subsystems. From: Ben Blum bb...@andrew.cmu.edu Signed-off-by: Ben Blum bb...@andrew.cmu.edu --- kernel/cgroup.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/kernel/cgroup.c b

[Devel] [PATCH v2 2/2] cgroups: blkio subsystem as module

2010-01-12 Thread Ben Blum
Convert blk-cgroup to be buildable as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies the Block I/O cgroup subsystem to be able to be built as a module. As the CFQ disk scheduler optionally depends on blk-cgroup, config options in block/Kconfig, block/Kconfig.iosched, and block

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-07 Thread Ben Blum
On Thu, Jan 07, 2010 at 04:51:17PM +0900, KAMEZAWA Hiroyuki wrote: On Thu, 7 Jan 2010 02:48:12 -0500 Ben Blum bb...@andrew.cmu.edu wrote: 2. Making this to be reasonable value. #define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long)) I can't find why. We limit

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-07 Thread Ben Blum
On Thu, Jan 07, 2010 at 02:42:19PM +0800, Li Zefan wrote: KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote: On Thu, 31 Dec 2009 00:10:50 -0500 Ben Blum bb...@andrew.cmu.edu

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-07 Thread Ben Blum
On Thu, Jan 07, 2010 at 03:14:32AM -0500, Ben Blum wrote: On Thu, Jan 07, 2010 at 02:42:19PM +0800, Li Zefan wrote: KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-07 Thread Ben Blum
On Thu, Jan 07, 2010 at 02:42:19PM +0800, Li Zefan wrote: KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote: On Thu, 31 Dec 2009 00:10:50 -0500 Ben Blum bb...@andrew.cmu.edu

[Devel] [RFC] [PATCH 1/2] cgroups: modular subsystems support for use_id

2010-01-07 Thread Ben Blum
On Fri, Jan 08, 2010 at 12:27:34AM -0500, Ben Blum wrote: On Thu, Jan 07, 2010 at 02:42:19PM +0800, Li Zefan wrote: KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote

[Devel] [RFC] [PATCH 2/2] cgroups: blkio subsystem as module

2010-01-07 Thread Ben Blum
Convert blk-cgroup to be buildable as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies the Block I/O cgroup subsystem to be able to be built as a module. As the CFQ disk scheduler optionally depends on blk-cgroup, config options in block/Kconfig, block/Kconfig.iosched, and block

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-06 Thread Ben Blum
On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote: On Thu, 31 Dec 2009 00:10:50 -0500 Ben Blum bb...@andrew.cmu.edu wrote: This patch series implements support for building, loading, and unloading subsystems as modules, both within and outside the kernel source tree

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-06 Thread Ben Blum
On Thu, Jan 07, 2010 at 04:16:27PM +0900, KAMEZAWA Hiroyuki wrote: On Thu, 07 Jan 2010 14:42:19 +0800 Li Zefan l...@cn.fujitsu.com wrote: KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800

[Devel] Re: + cgroups-add-functionality-to-read-write-lock-clone_thread-forking-pe r-threadgroup.patch added to -mm tree

2010-01-03 Thread Ben Blum
On Sat, Aug 22, 2009 at 03:09:52PM +0200, Oleg Nesterov wrote: OK, cgroups-add-ability-to-move-all-threads-in-a-process-to-a-new-cgroup-atomically.patch does threadgroup_sighand = threadgroup_fork_lock(leader); rcu_read_lock(); list_for_each_entry_rcu(tsk,

[Devel] [RFC] [PATCH 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup

2010-01-03 Thread Ben Blum
Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup From: Ben Blum bb...@andrew.cmu.edu This patch adds an rwsem that lives in a threadgroup's sighand_struct (next to the sighand's atomic count, to piggyback on its cacheline), and two functions in kernel/cgroup.c

[Devel] [RFC] [PATCH 2/2] cgroups: make procs file writable

2010-01-03 Thread Ben Blum
Makes procs file writable to move all threads by tgid at once From: Ben Blum bb...@andrew.cmu.edu This patch adds functionality that enables users to move all threads in a threadgroup at once to a cgroup by writing the tgid to the 'cgroup.procs' file. This current implementation makes use

[Devel] [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2009-12-30 Thread Ben Blum
[This is a revision of http://lkml.org/lkml/2009/12/21/211 ] This patch series implements support for building, loading, and unloading subsystems as modules, both within and outside the kernel source tree. It provides an interface cgroup_load_subsys() and cgroup_unload_subsys() which modular

[Devel] [PATCH v4 1/4] cgroups: revamp subsys array

2009-12-30 Thread Ben Blum
Make subsys[] able to be dynamically populated to support modular subsystems From: Ben Blum bb...@andrew.cmu.edu This patch reworks the way the subsys[] array is used so that subsystems can register themselves after boot time, and enables the internals of cgroups to be able to handle when

[Devel] [PATCH v4 2/4] cgroups: subsystem module loading interface

2009-12-30 Thread Ben Blum
On Thu, Dec 31, 2009 at 12:10:50AM -0500, Ben Blum wrote: [This is a revision of http://lkml.org/lkml/2009/12/21/211 ] This patch series implements support for building, loading, and unloading subsystems as modules, both within and outside the kernel source tree. It provides an interface

[Devel] [PATCH v4 3/4] cgroups: subsystem module unloading

2009-12-30 Thread Ben Blum
Provides support for unloading modular subsystems. From: Ben Blum bb...@andrew.cmu.edu This patch adds a new function cgroup_unload_subsys which is to be used for removing a loaded subsystem during module deletion. Reference counting of the subsystems' modules is moved from once (at load time

[Devel] [PATCH v4 4/4] cgroups: net_cls as module

2009-12-30 Thread Ben Blum
Allows the net_cls cgroup subsystem to be compiled as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem to be optionally compiled as a module instead of builtin. The cgroup_subsys struct is moved around a bit to allow

[Devel] Re: [PATCH 3/4] cgroups: net_cls as module

2009-12-28 Thread Ben Blum
On Mon, Dec 28, 2009 at 02:34:12PM +0800, Li Zefan wrote: Allows the net_cls cgroup subsystem to be compiled as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem to be optionally compiled as a module instead

[Devel] Re: [PATCH 2/4] cgroups: subsystem module loading interface

2009-12-28 Thread Ben Blum
On Mon, Dec 28, 2009 at 02:32:20PM +0800, Li Zefan wrote: Add interface between cgroups subsystem management and module loading From: Ben Blum bb...@andrew.cmu.edu This patch implements rudimentary module-loading support for cgroups - namely, a cgroup_load_subsys (similar

[Devel] [PATCH 0/4] cgroups: support for module-loadable subsystems

2009-12-21 Thread Ben Blum
[This is a revision of http://lkml.org/lkml/2009/12/4/53 ] This patch series implements support for building, loading, and unloading subsystems as modules, both within and outside the kernel source tree. It provides an interface cgroup_load_subsys() and cgroup_unload_subsys() which modular

[Devel] [PATCH 1/4] cgroups: revamp subsys array

2009-12-21 Thread Ben Blum
Make subsys[] able to be dynamically populated to support modular subsystems From: Ben Blum bb...@andrew.cmu.edu This patch reworks the way the subsys[] array is used so that subsystems can register themselves after boot time, and enables the internals of cgroups to be able to handle when

[Devel] [PATCH 2/4] cgroups: subsystem module loading interface

2009-12-21 Thread Ben Blum
Add interface between cgroups subsystem management and module loading From: Ben Blum bb...@andrew.cmu.edu This patch implements rudimentary module-loading support for cgroups - namely, a cgroup_load_subsys (similar to cgroup_init_subsys) for use as a module initcall, and a struct module pointer

[Devel] [PATCH 3/4] cgroups: net_cls as module

2009-12-21 Thread Ben Blum
Allows the net_cls cgroup subsystem to be compiled as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem to be optionally compiled as a module instead of builtin. The cgroup_subsys struct is moved around a bit to allow

[Devel] [PATCH 4/4] cgroups: subsystem module unloading

2009-12-21 Thread Ben Blum
Provides support for unloading modular subsystems. From: Ben Blum bb...@andrew.cmu.edu This patch adds a new function cgroup_unload_subsys which is to be used for removing a loaded subsystem during module deletion. Reference counting of the subsystems' modules is moved from once (at load time

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Ben Blum
On Wed, Dec 09, 2009 at 02:07:53PM +0800, Li Zefan wrote: Ben Blum wrote: On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote: @@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Ben Blum
On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote: @@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read(subsys_mutex); Hmm.. this can lead to

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Ben Blum
On Thu, Dec 10, 2009 at 11:18:06AM +0800, Li Zefan wrote: And it can really lead to deadlock, though not so obivously: thread 1 thread 2thread 3 --- | read(A)write(B) | |write(A) | |

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Ben Blum
On Thu, Dec 10, 2009 at 02:00:29PM +0800, Li Zefan wrote: Yes, but it doesn't mean we should use rw lock or rw semaphore is preferable than plain mutex. - the read side of subsys_mutex is mainly at mount/remount/umount, the write side is in cgroup_load_subsys() and cgroup_unload_subsys().

[Devel] Re: [RFC] [PATCH 5/5] cgroups: subsystem dependencies

2009-12-08 Thread Ben Blum
On Tue, Dec 08, 2009 at 02:11:21PM +0800, Li Zefan wrote: This patch adds a mechanism with which a subsystem can specify dependencies on other subsystems. Since subsystems can come and go, it would not be useful to refer to a depended-upon subsystem by subsys_id, so instead a

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-08 Thread Ben Blum
On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote: @@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read(subsys_mutex); Hmm.. this can lead to

[Devel] [RFC] [PATCH 0/5] cgroups: support for module-loadable subsystems

2009-12-04 Thread Ben Blum
[This is a revision of http://lkml.org/lkml/2009/11/2/442 ] This patch series implements support for building, loading, and unloading subsystems as modules, both within and outside the kernel source tree. It provides an interface cgroup_load_subsys() and cgroup_unload_subsys() which modular

[Devel] [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-04 Thread Ben Blum
Make subsys[] able to be dynamically populated to support modular subsystems From: Ben Blum bb...@andrew.cmu.edu This patch reworks the way the subsys[] array is used so that subsystems can register themselves after boot time, and enables the internals of cgroups to be able to handle when

[Devel] [RFC] [PATCH 2/5] cgroups: subsystem module loading interface

2009-12-04 Thread Ben Blum
Add interface between cgroups subsystem management and module loading From: Ben Blum bb...@andrew.cmu.edu This patch implements rudimentary module-loading support for cgroups - namely, a cgroup_load_subsys (similar to cgroup_init_subsys) for use as a module initcall, and a struct module pointer

[Devel] [RFC] [PATCH 3/5] cgroups: net_cls as module

2009-12-04 Thread Ben Blum
Allows the net_cls cgroup subsystem to be compiled as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem to be optionally compiled as a module instead of builtin. The cgroup_subsys struct is moved around a bit to allow

[Devel] [RFC] [PATCH 4/5] cgroups: subsystem module unloading

2009-12-04 Thread Ben Blum
Provides support for unloading modular subsystems. From: Ben Blum bb...@andrew.cmu.edu This patch adds a new function cgroup_unload_subsys which is to be used for removing a loaded subsystem during module deletion. Reference counting of the subsystems' modules is moved from once (at load time

[Devel] [RFC] [PATCH 5/5] cgroups: subsystem dependencies

2009-12-04 Thread Ben Blum
Adds support for cgroup subsystems to specify dependencies on other subsystems From: Ben Blum bb...@andrew.cmu.edu This patch adds a mechanism with which a subsystem can specify dependencies on other subsystems. Since subsystems can come and go, it would not be useful to refer to a depended-upon

[Devel] [RFC][PATCH 0/3] cgroups: support for module-loadable subsystems

2009-11-02 Thread Ben Blum
This patch series implements simple support for building and loading subsystems as modules, both within and outside the kernel source tree. Module unloading is as yet unimplemented - it will require more advanced reference counting in the mount/unmount code, and I plan to work on this soon. Patch

[Devel] [RFC][PATCH 2/3] cgroups: subsystem module interface

2009-11-02 Thread Ben Blum
Add interface between cgroups subsystem management and module loading From: Ben Blum bb...@andrew.cmu.edu This patch implements rudimentary module-loading support for cgroups - namely, a cgroup_load_subsys (similar to cgroup_init_subsys) for use as a module initcall, and a struct module pointer

[Devel] [RFC][PATCH 1/3] cgroups: revamp subsys array

2009-11-02 Thread Ben Blum
Make subsys[] able to be dynamically populated to support modular subsystems From: Ben Blum bb...@andrew.cmu.edu This patch reworks the way the subsys[] array is used so that subsystems can register themselves after boot time, and enables the internals of cgroups to be able to handle when

[Devel] [RFC][PATCH 3/3] cgroups: net_cls subsys as module

2009-11-02 Thread Ben Blum
Allows the net_cls cgroup subsystem to be compiled as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem to be optionally compiled as a module instead of builtin. The cgroup_subsys struct is moved around a bit to allow

[Devel] Re: [PATCH 7/8] Adds functionality to read/write lock CLONE_THREAD fork()ing per-threadgroup

2009-09-02 Thread Ben Blum
On Thu, Aug 20, 2009 at 02:13:56PM -0700, Andrew Morton wrote: On Wed, 19 Aug 2009 19:45:11 -0700 Paul Menage men...@google.com wrote: On Wed, Aug 19, 2009 at 7:39 PM, Li Zefanl...@cn.fujitsu.com wrote: + __ __ __ __ __ __ list_for_each_entry_rcu(p, tsk-thread_group, thread_group)

[Devel] [PATCH 3/7] Quick vmalloc vs kmalloc fix to the case where array size is too large

2009-08-10 Thread Ben Blum
be replaced entirely with a kernel-wide solution to this general problem. Depends on cgroup-pidlist-namespace.patch, cgroup-procs.patch Signed-off-by: Ben Blum bb...@google.com --- kernel/cgroup.c | 47 ++- 1 files changed, 42 insertions(+), 5 deletions

[Devel] [PATCH 2/7] Ensures correct concurrent opening/reading of pidlists across pid namespaces

2009-08-10 Thread Ben Blum
or its master list except when creating and destroying entries. Signed-off-by: Ben Blum bb...@google.com --- include/linux/cgroup.h | 34 +-- kernel/cgroup.c| 108 2 files changed, 120 insertions(+), 22 deletions(-) diff

[Devel] [PATCH 4/7] Changes css_set freeing mechanism to be under RCU

2009-08-10 Thread Ben Blum
() for each task before freeing its old css_set. Signed-off-by: Ben Blum bb...@google.com --- include/linux/cgroup.h |3 +++ kernel/cgroup.c|8 +++- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index b934b72..24e3f1a

  1   2   >