Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Tejun Heo
Hello, Alexei. On Fri, Aug 12, 2016 at 08:21:21AM -0700, Alexei Starovoitov wrote: > > lol I should have read the whole thread before replying twice. Sorry > > about that. Yeah, if we can still rename it, let's do "under". It's > > more intuitive and gives us the room to implement the real "in"

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Alexei Starovoitov
On Fri, Aug 12, 2016 at 09:29:35AM -0400, Tejun Heo wrote: > Hello, > > On Fri, Aug 12, 2016 at 09:40:39AM +0200, Daniel Borkmann wrote: > > > I actually wish we could rename skb_in_cgroup to skb_under_cgroup. If we > > > ever > > > introduced a check for absolute membership versus ancestral memb

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Tejun Heo
On Fri, Aug 12, 2016 at 09:21:39AM -0400, Tejun Heo wrote: > On Thu, Aug 11, 2016 at 09:50:48PM -0700, Sargun Dhillon wrote: > > I realize that in_cgroup is more consistent, but under_cgroup makes > > far more sense to me. I think it's more intuitive. > > So, I think in_cgroup should mean that the

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Tejun Heo
Hello, On Fri, Aug 12, 2016 at 09:40:39AM +0200, Daniel Borkmann wrote: > > I actually wish we could rename skb_in_cgroup to skb_under_cgroup. If we > > ever > > introduced a check for absolute membership versus ancestral membership, what > > would we call that? > > That option is, by the way, s

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Tejun Heo
On Thu, Aug 11, 2016 at 09:50:48PM -0700, Sargun Dhillon wrote: > I realize that in_cgroup is more consistent, but under_cgroup makes > far more sense to me. I think it's more intuitive. So, I think in_cgroup should mean that the object is in that particular cgroup while under_cgroup in the subhie

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Daniel Borkmann
On 08/12/2016 09:22 AM, Sargun Dhillon wrote: On Fri, Aug 12, 2016 at 09:16:07AM +0200, Daniel Borkmann wrote: On 08/12/2016 06:50 AM, Sargun Dhillon wrote: I realize that in_cgroup is more consistent, but under_cgroup makes far more sense to me. I think it's more intuitive. On Thu, Aug 11, 20

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Sargun Dhillon
On Fri, Aug 12, 2016 at 09:16:07AM +0200, Daniel Borkmann wrote: > On 08/12/2016 06:50 AM, Sargun Dhillon wrote: > >I realize that in_cgroup is more consistent, but under_cgroup makes > >far more sense to me. I think it's more intuitive. > > > >On Thu, Aug 11, 2016 at 9:48 PM, Alexei Starovoitov >

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-12 Thread Daniel Borkmann
On 08/12/2016 06:50 AM, Sargun Dhillon wrote: I realize that in_cgroup is more consistent, but under_cgroup makes far more sense to me. I think it's more intuitive. On Thu, Aug 11, 2016 at 9:48 PM, Alexei Starovoitov wrote: On Thu, Aug 11, 2016 at 08:14:56PM -0700, Sargun Dhillon wrote: This

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-11 Thread Sargun Dhillon
I realize that in_cgroup is more consistent, but under_cgroup makes far more sense to me. I think it's more intuitive. On Thu, Aug 11, 2016 at 9:48 PM, Alexei Starovoitov wrote: > On Thu, Aug 11, 2016 at 08:14:56PM -0700, Sargun Dhillon wrote: >> This adds a bpf helper that's similar to the skb_i

Re: [PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-11 Thread Alexei Starovoitov
On Thu, Aug 11, 2016 at 08:14:56PM -0700, Sargun Dhillon wrote: > This adds a bpf helper that's similar to the skb_in_cgroup helper to check > whether the probe is currently executing in the context of a specific > subset of the cgroupsv2 hierarchy. It does this based on membership test > for a cgr

[PATCH net-next v4 2/3] bpf: Add bpf_current_task_under_cgroup helper

2016-08-11 Thread Sargun Dhillon
This adds a bpf helper that's similar to the skb_in_cgroup helper to check whether the probe is currently executing in the context of a specific subset of the cgroupsv2 hierarchy. It does this based on membership test for a cgroup arraymap. It is invalid to call this in an interrupt, and it'll retu