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



How about:

```
    [cgroups2] Add isolate field for nested containers.

    Currently we do not support nested containers. We need to let nested
    containers pick whether they want their own resource constraints based
    on the LinuxInfo::share_cgroups field in the API.

    In cgroups v1, we didn't need to track an additional field for this,
    because the isolator does not store nested containers within its `infos`
    map.

    In cgroups v2, we will *always* create cgroups for nested containers,
    and LinuxInfo::share_cgroups instead specifies whether these cgroups
    will have resource isolation applied to them. (LinuxInfo::share_cgroups
    needs to be renamed accordingly).

    In later patches, we will use this to skip the update and isolate
    calls on the controllers if isolate == true.
```


src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp
Lines 123-125 (patched)
<https://reviews.apache.org/r/75167/#comment315141>

    how about:
    
    ```
    
         // Whether to perform resource isolation on this container.
         //   1. For non-nested containers, this will always be true.
         //   2. For nested containers, this may be true or false.
         //
         // This field is derived from LinuxInfo::share_cgroups.
         const bool isolate;
    ```



src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
Lines 224-229 (patched)
<https://reviews.apache.org/r/75167/#comment315140>

    hm.. in v1 shareCgroups is only relevant for nested containers (has_parent 
guards before looking at it)
    
    we should do something similar here, **or**, make the boolean accurate for 
any container (false for non-nested containers)



src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
Line 492 (original), 503 (patched)
<https://reviews.apache.org/r/75167/#comment315142>

    no const on primitive types in args, since they are always copied


- Benjamin Mahler


On Aug. 14, 2024, 12:09 a.m., Jason Zhou wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75167/
> -----------------------------------------------------------
> 
> (Updated Aug. 14, 2024, 12:09 a.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently we do not support nested containers. We need to let nested
> containers pick whether they want their own resource constraints.
> 
> We will do give the ability to choose with an 'isolate' field.
> If this field is set to false, it indicates the container does not
> want its own resource constraints, and does not want cgroups2 isolator
> to update its control files. In later patches, we will use this to skip
> the update and isolate calls on the controllers if isolate == true.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp 
> 07eb036818ba86c4171658cc40956b66ce5db8a5 
>   src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp 
> 762bb112203cdeac09d47c2350b7b767c9dc8340 
> 
> 
> Diff: https://reviews.apache.org/r/75167/diff/1/
> 
> 
> Testing
> -------
> 
> Compiles okay
> 
> 
> Thanks,
> 
> Jason Zhou
> 
>

Reply via email to