Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Jie Yu


> On Feb. 1, 2016, 9:40 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp, lines 454-455
> > 
> >
> > In fact, i think we should add a helper in src/linux/cgroup.hpp (like 
> > we did for other cgroups controls like cpu.shares, etc.)
> > 
> > ```
> > Try cgroups::net_cls::classid(uint32_t classid)
> > ```
> 
> Avinash sridharan wrote:
> Will do. Will create a separate patch and make this dependent on the new 
> patch.

Yeah, that's fine.


- Jie


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117275
---


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Avinash sridharan


> On Feb. 1, 2016, 8:14 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp, lines 499-503
> > 
> >
> > You should do this after the cgroup has been destroyed.

Makes sense. Planning to convert the lamdba being used in the defer for cleanup 
into a function, since we are adding more logic to the Lambda now. Hope that's 
fine?


- Avinash


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117243
---


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Avinash sridharan


> On Feb. 1, 2016, 9:40 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp, lines 454-455
> > 
> >
> > In fact, i think we should add a helper in src/linux/cgroup.hpp (like 
> > we did for other cgroups controls like cpu.shares, etc.)
> > 
> > ```
> > Try cgroups::net_cls::classid(uint32_t classid)
> > ```

Will do. Will create a separate patch and make this dependent on the new patch.


- Avinash


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117275
---


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Jie Yu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117275
---




src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 454 - 455)


In fact, i think we should add a helper in src/linux/cgroup.hpp (like we 
did for other cgroups controls like cpu.shares, etc.)

```
Try cgroups::net_cls::classid(uint32_t classid)
```


- Jie Yu


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Avinash sridharan


> On Feb. 1, 2016, 8:14 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp, lines 38-39
> > 
> >
> > What do we need this? Should we expose that using agent flags.

This is the default major handle we are using for this commit. In MESOS-4344 we 
are moving this to an agent flag. However for MESOS-4345 we need this be a 
#define.


- Avinash


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117243
---


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-02-01 Thread Jie Yu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/#review117243
---




src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp (lines 38 - 39)


What do we need this? Should we expose that using agent flags.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 282 - 294)


I would pull this into a helper function in src/linux/cgroup.hpp|cpp

```
Try cgroups::net_cls::classid(hierachy, cgroup);
```

This can be in a separate patch.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 285 - 286)


Please align the error message accordingly.
```
return Failure(
"Unable to ..." +
stringify(...));
```



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 292 - 293)


Ditto here.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 300 - 301)


Ditto on alignment.

Do you also need to clear 'infos' to be consistent?



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 329 - 334)


For known orphans, you want to recovery the classid as well. Otherwise, 
those handles will be allocated to others while the known orphan containers are 
still using it.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 413)


s/netHandle/handle/



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 418)


We typically put '+' at the end of the previous line.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 440 - 443)


Can you try to see if writing a decimal number if fine as well? If not, we 
should move the helper function into cpp as a file local helper.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 454)


s/allocate/write/



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 457 - 458)


Ditto on error message alignment.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 491 - 497)


I don't think this is necessary.



src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 499 - 503)


You should do this after the cgroup has been destroyed.


- Jie Yu


On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42618/
> ---
> 
> (Updated Jan. 31, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-4345
> https://issues.apache.org/jira/browse/MESOS-4345
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
> handles that will be used by the net_cls cgroup subsystem.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
> b4bc52114389d1c1efce2830f4292bd89bb0de7c 
>   src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
> ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 
> 
> Diff: https://reviews.apache.org/r/42618/diff/
> 
> 
> Testing
> ---
> 
> make and make check
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-01-31 Thread Avinash sridharan

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/
---

(Updated Jan. 31, 2016, 8:06 p.m.)


Review request for mesos and Jie Yu.


Bugs: MESOS-4345
https://issues.apache.org/jira/browse/MESOS-4345


Repository: mesos


Description (updated)
---

The `NetClsHandleMgr` will be responsible for keeping track of the net_cls
handles that will be used by the net_cls cgroup subsystem.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
b4bc52114389d1c1efce2830f4292bd89bb0de7c 
  src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
ddc1bf0939e5e8995e6f34fe7b8509b51704f63e 

Diff: https://reviews.apache.org/r/42618/diff/


Testing
---

make and make check


Thanks,

Avinash sridharan



Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.

2016-01-25 Thread Avinash sridharan

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42618/
---

(Updated Jan. 26, 2016, 6:35 a.m.)


Review request for mesos and Jie Yu.


Summary (updated)
-

Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`.


Bugs: MESOS-4345
https://issues.apache.org/jira/browse/MESOS-4345


Repository: mesos


Description
---

Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr` to manage 
net_cls handles.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp 
7ce5243ed7476a1cfd1371b5ce25b62dc07432db 
  src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp 
0798de747627ccc45b01a2668e16693757dc69a8 

Diff: https://reviews.apache.org/r/42618/diff/


Testing (updated)
---

make and make check


Thanks,

Avinash sridharan