You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jason Zhou <ja...@gmail.com> on 2024/07/25 20:02:52 UTC

Review Request 75104: [cgroups2] Add helper to normalize allow/deny list

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

Review request for mesos and Benjamin Mahler.


Repository: mesos


Description
-------

This patch adds a public helper function to abstract away the logic used
to make a list comply with the 'normalized' requirements.
As a reminder:
An allow or deny list is 'normalized' iff everything below are true:
1. No Entry can have no accesses specified
2. No two entries on the same list can have the same type, major & minor
numbers.
3. No two entries on the same list can be encompassed by the other
entry.

The normalize helper is available for use for all modifications to the
cgroup device access state.


Diffs
-----

  src/slave/containerizer/device_manager/device_manager.hpp 7c8523d8bdddb8e95c47e1812b48520296680ad6 
  src/slave/containerizer/device_manager/device_manager.cpp 4c9b86393f0809e08d79b6354940826bd56116f2 
  src/tests/device_manager_tests.cpp 54d464e97c8fd179128239a6757b16dfa0147c54 


Diff: https://reviews.apache.org/r/75104/diff/1/


Testing
-------

Updated DeviceManager tests cases to check that the state after configure fulfills the above three criteria. Tests pass


Thanks,

Jason Zhou


Re: Review Request 75104: [cgroups2] Add helper to normalize allow/deny list

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75104/#review226724
-----------------------------------------------------------


Fix it, then Ship it!





src/linux/cgroups2.cpp
Lines 1555-1580 (patched)
<https://reviews.apache.org/r/75104/#comment315004>

    this could just use a hashmap<string, Entry>?



src/linux/cgroups2.cpp
Lines 1590-1592 (patched)
<https://reviews.apache.org/r/75104/#comment315003>

    simplifiable with selector equality


- Benjamin Mahler


On July 26, 2024, 6:04 p.m., Jason Zhou wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75104/
> -----------------------------------------------------------
> 
> (Updated July 26, 2024, 6:04 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch adds a public helper function to abstract away the logic used
> to make a list comply with the 'normalized' requirements.
> As a reminder:
> An allow or deny list is 'normalized' iff everything below are true:
> 1. No Entry can have no accesses specified
> 2. No two entries on the same list can have the same type, major & minor
> numbers.
> 3. No two entries on the same list can be encompassed by the other
> entry.
> 
> 
> Diffs
> -----
> 
>   src/linux/cgroups2.hpp accaebdaddc85acdd96b87161ea441c77b025099 
>   src/linux/cgroups2.cpp ac46782614f6b3b6cb6f2f685492df8364cb73a3 
>   src/tests/containerizer/cgroups2_tests.cpp 39f17460c8911244ba28ab052281785dd6235240 
> 
> 
> Diff: https://reviews.apache.org/r/75104/diff/5/
> 
> 
> Testing
> -------
> 
> Added tests for normalize(), tests pass.
> 
> 
> Thanks,
> 
> Jason Zhou
> 
>


Re: Review Request 75104: [cgroups2] Add helper to normalize allow/deny list

Posted by Jason Zhou <ja...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75104/
-----------------------------------------------------------

(Updated July 26, 2024, 6:04 p.m.)


Review request for mesos and Benjamin Mahler.


Repository: mesos


Description (updated)
-------

This patch adds a public helper function to abstract away the logic used
to make a list comply with the 'normalized' requirements.
As a reminder:
An allow or deny list is 'normalized' iff everything below are true:
1. No Entry can have no accesses specified
2. No two entries on the same list can have the same type, major & minor
numbers.
3. No two entries on the same list can be encompassed by the other
entry.


Diffs (updated)
-----

  src/linux/cgroups2.hpp accaebdaddc85acdd96b87161ea441c77b025099 
  src/linux/cgroups2.cpp ac46782614f6b3b6cb6f2f685492df8364cb73a3 
  src/tests/containerizer/cgroups2_tests.cpp 39f17460c8911244ba28ab052281785dd6235240 


Diff: https://reviews.apache.org/r/75104/diff/3/

Changes: https://reviews.apache.org/r/75104/diff/2-3/


Testing (updated)
-------

Added tests for normalize(), tests pass.


Thanks,

Jason Zhou


Re: Review Request 75104: [cgroups2] Add helper to normalize allow/deny list

Posted by Jason Zhou <ja...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75104/
-----------------------------------------------------------

(Updated July 25, 2024, 11:48 p.m.)


Review request for mesos and Benjamin Mahler.


Repository: mesos


Description
-------

This patch adds a public helper function to abstract away the logic used
to make a list comply with the 'normalized' requirements.
As a reminder:
An allow or deny list is 'normalized' iff everything below are true:
1. No Entry can have no accesses specified
2. No two entries on the same list can have the same type, major & minor
numbers.
3. No two entries on the same list can be encompassed by the other
entry.

The normalize helper is available for use for all modifications to the
cgroup device access state.


Diffs (updated)
-----

  src/slave/containerizer/device_manager/device_manager.hpp 7c8523d8bdddb8e95c47e1812b48520296680ad6 
  src/slave/containerizer/device_manager/device_manager.cpp 4c9b86393f0809e08d79b6354940826bd56116f2 
  src/tests/device_manager_tests.cpp 54d464e97c8fd179128239a6757b16dfa0147c54 


Diff: https://reviews.apache.org/r/75104/diff/2/

Changes: https://reviews.apache.org/r/75104/diff/1-2/


Testing
-------

Updated DeviceManager tests cases to check that the state after configure fulfills the above three criteria. Tests pass


Thanks,

Jason Zhou