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

2015-04-17 Thread Aleksa Sarai
>> Do you mean like this? >> >> #define SUBSYS_TAG_COUNT(_tag) (CGROUP_ ## _tag ## _END - CGROUP_ ## >> _tag ## _START) >> >> That's fine I guess, I just wanted to match CGROUP_SUBSYS_COUNT in >> semantics, but I'll do that if you prefer it that way. > > Not even that, just do it manually. > > #def

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

2015-04-17 Thread Tejun Heo
On Sat, Apr 18, 2015 at 06:48:55AM +1000, Aleksa Sarai wrote: > Do you mean like this? > > #define SUBSYS_TAG_COUNT(_tag) (CGROUP_ ## _tag ## _END - CGROUP_ ## > _tag ## _START) > > That's fine I guess, I just wanted to match CGROUP_SUBSYS_COUNT in > semantics, but I'll do that if you prefer it t

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

2015-04-17 Thread Aleksa Sarai
>> >> Do you also want me to completely drop the COUNT macro? IMO it makes >> >> the CGROUP__COUNT consolidation much nicer. >> > >> > What's wrong with simply having start and end tags? >> >> Because you'd have to write (CGROUP_TAG_END - CGROUP_TAG_START) every >> time? It's a small addition and i

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

2015-04-17 Thread Tejun Heo
On Sat, Apr 18, 2015 at 06:35:41AM +1000, Aleksa Sarai wrote: > >> Do you also want me to completely drop the COUNT macro? IMO it makes > >> the CGROUP__COUNT consolidation much nicer. > > > > What's wrong with simply having start and end tags? > > Because you'd have to write (CGROUP_TAG_END - CGR

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

2015-04-17 Thread Aleksa Sarai
>> Do you also want me to completely drop the COUNT macro? IMO it makes >> the CGROUP__COUNT consolidation much nicer. > > What's wrong with simply having start and end tags? Because you'd have to write (CGROUP_TAG_END - CGROUP_TAG_START) every time? It's a small addition and it makes referencing

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

2015-04-17 Thread Tejun Heo
On Thu, Apr 16, 2015 at 11:57:29PM +1000, Aleksa Sarai wrote: > Do you also want me to completely drop the COUNT macro? IMO it makes > the CGROUP__COUNT consolidation much nicer. What's wrong with simply having start and end tags? -- tejun -- To unsubscribe from this list: send the line "unsubsc

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

2015-04-16 Thread Aleksa Sarai
Hi, Do you also want me to completely drop the COUNT macro? IMO it makes the CGROUP__COUNT consolidation much nicer. -- Aleksa Sarai (cyphar) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majord

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

2015-04-14 Thread Tejun Heo
Hello, On Tue, Apr 14, 2015 at 10:33:41AM +1000, Aleksa Sarai wrote: > Hi Tejun, > > > Ummm... is this really necessary? Can't we do something like the > > following? > > > > #define SUBSYS_TAG(tag) \ > > __##tag,

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

2015-04-13 Thread Aleksa Sarai
Hi Tejun, > Ummm... is this really necessary? Can't we do something like the > following? > > #define SUBSYS_TAG(tag) \ > __##tag,\ > tag = __##tag - 2, Is which part necessary? That's what TA

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

2015-04-13 Thread Tejun Heo
On Sun, Apr 12, 2015 at 10:51:56AM +1000, Aleksa Sarai wrote: > +/* list of all tags for subsystems */ > +enum cgroup_subsys_tag { > +#define TAG_ID(_t) CGROUP_ ## _t > +#define SUBSYS(_x) UNUSED_IDENT(_x), > +#define TAG(_t) TAG_ID(_t), \ > + UNUSED_IDENT(_t) = TAG_ID(_t) - 2, > +#define _COUN

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

2015-04-11 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 pr