mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qian Zhang <zhang...@cn.ibm.com>
Subject Re: Review Request 49814: Implemented `CgroupsIsolatorProcess::create`.
Date Tue, 26 Jul 2016 00:26:13 GMT


> On July 25, 2016, 9:46 p.m., Qian Zhang wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp, lines 82-86
> > <https://reviews.apache.org/r/49814/diff/12/?file=1451776#file1451776line82>
> >
> >     I think besides preparing the hierarchy, we also need to ensure no other subsystem
is attached to the hierarchy, see the following code as an example:
> >     https://github.com/apache/mesos/blob/1.0.0-rc4/src/slave/containerizer/mesos/isolators/cgroups/mem.cpp#L95:L105
> >     
> >     Maybe you can do it in each subsystem's `load()` method.
> 
> haosdent huang wrote:
>     We don't need add this check because there may be multiple subsystems attach to a
same hierarchy. For example, if `cpu` and `cpuacct` attached to the same hierarchy `/a`, this
check would failed.

Understood, but I think we should still be able to handle that case with the code below in
the `load()` method of both `cpu` and `cpuacct` subsystems:
```
    // Ensure that no other subsystem is attached to the hierarchy.
    Try<set<string>> _subsystems = cgroups::subsystems(hierarchy.get());
    if (_subsystems.isError()) {
      return Error(
          "Failed to get the list of attached subsystems for hierarchy " +
          hierarchy.get());
    } else if (_subsystems.get().size() != 1) {
      foreach (const string& subsystem, subsystems.get()) {
        if (subsystem != "cpu" && subsystem != "cpuacct") {
          return Error(
              "Unexpected subsystems found attached to the hierarchy " +
              hierarchy.get());
        }
    }
```

You can take a look at the following code as an reference:
https://github.com/apache/mesos/blob/1.0.0-rc4/src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp#L267:L273


- Qian


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


On July 25, 2016, 10:35 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49814/
> -----------------------------------------------------------
> 
> (Updated July 25, 2016, 10:35 a.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, Qian Zhang, and Zhengju Sha.
> 
> 
> Bugs: MESOS-5041
>     https://issues.apache.org/jira/browse/MESOS-5041
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented `CgroupsIsolatorProcess::create`.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp 4a9f55bf3b217405bf90943f27a976422877a99e

> 
> Diff: https://reviews.apache.org/r/49814/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> haosdent huang
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message