Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-05-14 Thread Tejun Heo
Hello, Aleksa. On Thu, May 14, 2015 at 08:57:49PM +1000, Aleksa Sarai wrote: > >> +/* Ditto for the can_fork/cancel_fork/reapply_fork callbacks. */ > >> +static int need_canfork_callback __read_mostly; > >> +static int need_cancelfork_callback __read_mostly; > > > > And given that the reason we

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-05-14 Thread Aleksa Sarai
Hi Tejun, >> +/* Ditto for the can_fork/cancel_fork/reapply_fork callbacks. */ >> +static int need_canfork_callback __read_mostly; >> +static int need_cancelfork_callback __read_mostly; > > And given that the reason we have these masks is avoiding iteration in > relatively hot paths. Does

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-05-14 Thread Tejun Heo
Hello, Aleksa. On Thu, May 14, 2015 at 08:57:49PM +1000, Aleksa Sarai wrote: +/* Ditto for the can_fork/cancel_fork/reapply_fork callbacks. */ +static int need_canfork_callback __read_mostly; +static int need_cancelfork_callback __read_mostly; And given that the reason we have these

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-05-14 Thread Aleksa Sarai
Hi Tejun, +/* Ditto for the can_fork/cancel_fork/reapply_fork callbacks. */ +static int need_canfork_callback __read_mostly; +static int need_cancelfork_callback __read_mostly; And given that the reason we have these masks is avoiding iteration in relatively hot paths. Does cancelfork mask

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-24 Thread Tejun Heo
On Fri, Apr 24, 2015 at 11:59:31PM +1000, Aleksa Sarai wrote: > Hey, > > >> +#define CGROUP_PREFORK_COUNT 0 > >> + > >> static inline int cgroup_init_early(void) { return 0; } > >> static inline int cgroup_init(void) { return 0; } > >> static inline void cgroup_fork(struct task_struct *p) {} >

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-24 Thread Aleksa Sarai
Hey, >> +#define CGROUP_PREFORK_COUNT 0 >> + >> static inline int cgroup_init_early(void) { return 0; } >> static inline int cgroup_init(void) { return 0; } >> static inline void cgroup_fork(struct task_struct *p) {} >> -static inline void cgroup_post_fork(struct task_struct *p) {} >> +static

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-24 Thread Aleksa Sarai
Hey, +#define CGROUP_PREFORK_COUNT 0 + static inline int cgroup_init_early(void) { return 0; } static inline int cgroup_init(void) { return 0; } static inline void cgroup_fork(struct task_struct *p) {} -static inline void cgroup_post_fork(struct task_struct *p) {} +static inline int

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-24 Thread Tejun Heo
On Fri, Apr 24, 2015 at 11:59:31PM +1000, Aleksa Sarai wrote: Hey, +#define CGROUP_PREFORK_COUNT 0 + static inline int cgroup_init_early(void) { return 0; } static inline int cgroup_init(void) { return 0; } static inline void cgroup_fork(struct task_struct *p) {} -static inline

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-22 Thread Tejun Heo
On Sun, Apr 19, 2015 at 10:22:33PM +1000, Aleksa Sarai wrote: > @@ -25,6 +25,19 @@ > > #ifdef CONFIG_CGROUPS > > +/* define the enumeration of all cgroup subsystems */ > +enum cgroup_subsys_id { > +#define SUBSYS(_x) _x ## _cgrp_id, > +#define SUBSYS_TAG(_t) CGROUP_ ## _t, \ > +

Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-22 Thread Tejun Heo
On Sun, Apr 19, 2015 at 10:22:33PM +1000, Aleksa Sarai wrote: @@ -25,6 +25,19 @@ #ifdef CONFIG_CGROUPS +/* define the enumeration of all cgroup subsystems */ +enum cgroup_subsys_id { +#define SUBSYS(_x) _x ## _cgrp_id, +#define SUBSYS_TAG(_t) CGROUP_ ## _t, \ + __unused_tag_ ##

[PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-19 Thread Aleksa Sarai
Add a new cgroup subsystem callback can_fork that conditionally states whether or not the fork is accepted or rejected by a cgroup policy. In addition, add a cancel_fork callback so that if an error occurs later in the forking process, any state modified by can_fork can be reverted. Allow for a

[PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork

2015-04-19 Thread Aleksa Sarai
Add a new cgroup subsystem callback can_fork that conditionally states whether or not the fork is accepted or rejected by a cgroup policy. In addition, add a cancel_fork callback so that if an error occurs later in the forking process, any state modified by can_fork can be reverted. Allow for a