You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/12/16 23:03:00 UTC

mesos git commit: Added stub classes for rest cgroups subsystems.

Repository: mesos
Updated Branches:
  refs/heads/master 71eb9c739 -> b495fda02


Added stub classes for rest cgroups subsystems.

Review: https://reviews.apache.org/r/53546/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b495fda0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b495fda0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b495fda0

Branch: refs/heads/master
Commit: b495fda02566ee6e47ac5a618a6b14ff556e0d76
Parents: 71eb9c7
Author: haosdent huang <ha...@gmail.com>
Authored: Fri Dec 16 14:13:39 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Dec 16 14:13:39 2016 -0800

----------------------------------------------------------------------
 src/CMakeLists.txt                              |  5 ++
 src/Makefile.am                                 | 10 ++++
 src/slave/containerizer/mesos/containerizer.cpp |  5 ++
 .../mesos/isolators/cgroups/cgroups.cpp         |  5 ++
 .../mesos/isolators/cgroups/constants.hpp       |  5 ++
 .../mesos/isolators/cgroups/subsystem.cpp       | 10 ++++
 .../isolators/cgroups/subsystems/blkio.cpp      | 45 +++++++++++++++
 .../isolators/cgroups/subsystems/blkio.hpp      | 60 ++++++++++++++++++++
 .../isolators/cgroups/subsystems/cpuset.cpp     | 45 +++++++++++++++
 .../isolators/cgroups/subsystems/cpuset.hpp     | 60 ++++++++++++++++++++
 .../isolators/cgroups/subsystems/hugetlb.cpp    | 45 +++++++++++++++
 .../isolators/cgroups/subsystems/hugetlb.hpp    | 60 ++++++++++++++++++++
 .../isolators/cgroups/subsystems/net_prio.cpp   | 45 +++++++++++++++
 .../isolators/cgroups/subsystems/net_prio.hpp   | 60 ++++++++++++++++++++
 .../mesos/isolators/cgroups/subsystems/pids.cpp | 45 +++++++++++++++
 .../mesos/isolators/cgroups/subsystems/pids.hpp | 60 ++++++++++++++++++++
 16 files changed, 565 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0cc0451..c8d4260 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -272,12 +272,17 @@ set(LINUX_SRC
   slave/containerizer/mesos/isolators/appc/runtime.cpp
   slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystem.cpp
+  slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.cpp
+  slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp
+  slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.cpp
+  slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp
   slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.cpp
+  slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp
   slave/containerizer/mesos/isolators/docker/runtime.cpp
   slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
   slave/containerizer/mesos/isolators/filesystem/linux.cpp

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index b9db779..0f62ec7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1105,12 +1105,17 @@ MESOS_LINUX_FILES =									\
   slave/containerizer/mesos/isolators/appc/runtime.cpp					\
   slave/containerizer/mesos/isolators/cgroups/cgroups.cpp				\
   slave/containerizer/mesos/isolators/cgroups/subsystem.cpp				\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.cpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.cpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.cpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp			\
   slave/containerizer/mesos/isolators/docker/runtime.cpp				\
   slave/containerizer/mesos/isolators/docker/volume/isolator.cpp			\
   slave/containerizer/mesos/isolators/filesystem/linux.cpp				\
@@ -1143,12 +1148,17 @@ MESOS_LINUX_FILES +=									\
   slave/containerizer/mesos/isolators/cgroups/cgroups.hpp				\
   slave/containerizer/mesos/isolators/cgroups/constants.hpp				\
   slave/containerizer/mesos/isolators/cgroups/subsystem.hpp				\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.hpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/devices.hpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.hpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp			\
   slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.hpp			\
+  slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp			\
   slave/containerizer/mesos/isolators/docker/runtime.hpp				\
   slave/containerizer/mesos/isolators/docker/volume/isolator.hpp			\
   slave/containerizer/mesos/isolators/filesystem/linux.hpp				\

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index a4daff6..d9d5619 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -308,11 +308,16 @@ Try<MesosContainerizer*> MesosContainerizer::create(
 #endif // __WINDOWS__
 
 #ifdef __linux__
+    {"cgroups/blkio", &CgroupsIsolatorProcess::create},
     {"cgroups/cpu", &CgroupsIsolatorProcess::create},
+    {"cgroups/cpuset", &CgroupsIsolatorProcess::create},
     {"cgroups/devices", &CgroupsIsolatorProcess::create},
+    {"cgroups/hugetlb", &CgroupsIsolatorProcess::create},
     {"cgroups/mem", &CgroupsIsolatorProcess::create},
     {"cgroups/net_cls", &CgroupsIsolatorProcess::create},
+    {"cgroups/net_prio", &CgroupsIsolatorProcess::create},
     {"cgroups/perf_event", &CgroupsIsolatorProcess::create},
+    {"cgroups/pids", &CgroupsIsolatorProcess::create},
     {"appc/runtime", &AppcRuntimeIsolatorProcess::create},
     {"docker/runtime", &DockerRuntimeIsolatorProcess::create},
     {"docker/volume", &DockerVolumeIsolatorProcess::create},

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
index 3955cc4..b3a2695 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
@@ -77,12 +77,17 @@ Try<Isolator*> CgroupsIsolatorProcess::create(const Flags& flags)
 
   // Multimap: isolator name -> subsystem name.
   multihashmap<string, string> isolatorMap = {
+    {"blkio", CGROUP_SUBSYSTEM_BLKIO_NAME},
     {"cpu", CGROUP_SUBSYSTEM_CPU_NAME},
     {"cpu", CGROUP_SUBSYSTEM_CPUACCT_NAME},
+    {"cpuset", CGROUP_SUBSYSTEM_CPUSET_NAME},
     {"devices", CGROUP_SUBSYSTEM_DEVICES_NAME},
+    {"hugetlb", CGROUP_SUBSYSTEM_HUGETLB_NAME},
     {"mem", CGROUP_SUBSYSTEM_MEMORY_NAME},
     {"net_cls", CGROUP_SUBSYSTEM_NET_CLS_NAME},
+    {"net_prio", CGROUP_SUBSYSTEM_NET_PRIO_NAME},
     {"perf_event", CGROUP_SUBSYSTEM_PERF_EVENT_NAME},
+    {"pids", CGROUP_SUBSYSTEM_PIDS_NAME},
   };
 
   foreach (string isolator, strings::tokenize(flags.isolation, ",")) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp b/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp
index 8c73efd..2897b07 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp
@@ -39,12 +39,17 @@ const Bytes MIN_MEMORY = Megabytes(32);
 
 
 // Subsystem names.
+const std::string CGROUP_SUBSYSTEM_BLKIO_NAME = "blkio";
 const std::string CGROUP_SUBSYSTEM_CPU_NAME = "cpu";
 const std::string CGROUP_SUBSYSTEM_CPUACCT_NAME = "cpuacct";
+const std::string CGROUP_SUBSYSTEM_CPUSET_NAME = "cpuset";
 const std::string CGROUP_SUBSYSTEM_DEVICES_NAME = "devices";
+const std::string CGROUP_SUBSYSTEM_HUGETLB_NAME = "hugetlb";
 const std::string CGROUP_SUBSYSTEM_MEMORY_NAME = "memory";
 const std::string CGROUP_SUBSYSTEM_NET_CLS_NAME = "net_cls";
+const std::string CGROUP_SUBSYSTEM_NET_PRIO_NAME = "net_prio";
 const std::string CGROUP_SUBSYSTEM_PERF_EVENT_NAME = "perf_event";
+const std::string CGROUP_SUBSYSTEM_PIDS_NAME = "pids";
 
 } // namespace slave {
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystem.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystem.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystem.cpp
index bf7dc9e..9afa02b 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/subsystem.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystem.cpp
@@ -20,12 +20,17 @@
 #include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
 
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/devices.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp"
 #include "slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp"
 
 using mesos::slave::ContainerLimitation;
 
@@ -45,12 +50,17 @@ Try<Owned<Subsystem>> Subsystem::create(
 {
   hashmap<string, Try<Owned<Subsystem>>(*)(const Flags&, const string&)>
     creators = {
+    {CGROUP_SUBSYSTEM_BLKIO_NAME, &BlkioSubsystem::create},
     {CGROUP_SUBSYSTEM_CPU_NAME, &CpuSubsystem::create},
     {CGROUP_SUBSYSTEM_CPUACCT_NAME, &CpuacctSubsystem::create},
+    {CGROUP_SUBSYSTEM_CPUSET_NAME, &CpusetSubsystem::create},
     {CGROUP_SUBSYSTEM_DEVICES_NAME, &DevicesSubsystem::create},
+    {CGROUP_SUBSYSTEM_HUGETLB_NAME, &HugetlbSubsystem::create},
     {CGROUP_SUBSYSTEM_MEMORY_NAME, &MemorySubsystem::create},
     {CGROUP_SUBSYSTEM_NET_CLS_NAME, &NetClsSubsystem::create},
+    {CGROUP_SUBSYSTEM_NET_PRIO_NAME, &NetPrioSubsystem::create},
     {CGROUP_SUBSYSTEM_PERF_EVENT_NAME, &PerfEventSubsystem::create},
+    {CGROUP_SUBSYSTEM_PIDS_NAME, &PidsSubsystem::create},
   };
 
   if (!creators.contains(name)) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp
new file mode 100644
index 0000000..6be0f9e
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <process/id.hpp>
+
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp"
+
+using process::Owned;
+
+using std::string;
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+Try<Owned<Subsystem>> BlkioSubsystem::create(
+    const Flags& flags,
+    const string& hierarchy)
+{
+  return Owned<Subsystem>(new BlkioSubsystem(flags, hierarchy));
+}
+
+
+BlkioSubsystem::BlkioSubsystem(
+    const Flags& _flags,
+    const string& _hierarchy)
+  : ProcessBase(process::ID::generate("cgroups-blkio-subsystem")),
+    Subsystem(_flags, _hierarchy) {}
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp
new file mode 100644
index 0000000..a2c575c
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_BLKIO_HPP__
+#define __CGROUPS_ISOLATOR_SUBSYSTEMS_BLKIO_HPP__
+
+#include <string>
+
+#include <process/owned.hpp>
+
+#include <stout/try.hpp>
+
+#include "slave/flags.hpp"
+
+#include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+/**
+ * Represent cgroups blkio subsystem.
+ */
+class BlkioSubsystem : public Subsystem
+{
+public:
+  static Try<process::Owned<Subsystem>> create(
+      const Flags& flags,
+      const std::string& hierarchy);
+
+  virtual ~BlkioSubsystem() {}
+
+  virtual std::string name() const
+  {
+    return CGROUP_SUBSYSTEM_BLKIO_NAME;
+  };
+
+private:
+  BlkioSubsystem(const Flags& flags, const std::string& hierarchy);
+};
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {
+
+#endif // __CGROUPS_ISOLATOR_SUBSYSTEMS_BLKIO_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp
new file mode 100644
index 0000000..328ebc6
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <process/id.hpp>
+
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp"
+
+using process::Owned;
+
+using std::string;
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+Try<Owned<Subsystem>> CpusetSubsystem::create(
+    const Flags& flags,
+    const string& hierarchy)
+{
+  return Owned<Subsystem>(new CpusetSubsystem(flags, hierarchy));
+}
+
+
+CpusetSubsystem::CpusetSubsystem(
+    const Flags& _flags,
+    const string& _hierarchy)
+  : ProcessBase(process::ID::generate("cgroups-cpuset-subsystem")),
+    Subsystem(_flags, _hierarchy) {}
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp
new file mode 100644
index 0000000..b5d712a
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_CPUSET_HPP__
+#define __CGROUPS_ISOLATOR_SUBSYSTEMS_CPUSET_HPP__
+
+#include <string>
+
+#include <process/owned.hpp>
+
+#include <stout/try.hpp>
+
+#include "slave/flags.hpp"
+
+#include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+/**
+ * Represent cgroups cpuset subsystem.
+ */
+class CpusetSubsystem : public Subsystem
+{
+public:
+  static Try<process::Owned<Subsystem>> create(
+      const Flags& flags,
+      const std::string& hierarchy);
+
+  virtual ~CpusetSubsystem() {}
+
+  virtual std::string name() const
+  {
+    return CGROUP_SUBSYSTEM_CPUSET_NAME;
+  };
+
+private:
+  CpusetSubsystem(const Flags& flags, const std::string& hierarchy);
+};
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {
+
+#endif // __CGROUPS_ISOLATOR_SUBSYSTEMS_CPUSET_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp
new file mode 100644
index 0000000..0af4d2e
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <process/id.hpp>
+
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp"
+
+using process::Owned;
+
+using std::string;
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+Try<Owned<Subsystem>> HugetlbSubsystem::create(
+    const Flags& flags,
+    const string& hierarchy)
+{
+  return Owned<Subsystem>(new HugetlbSubsystem(flags, hierarchy));
+}
+
+
+HugetlbSubsystem::HugetlbSubsystem(
+    const Flags& _flags,
+    const string& _hierarchy)
+  : ProcessBase(process::ID::generate("cgroups-hugetlb-subsystem")),
+    Subsystem(_flags, _hierarchy) {}
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp
new file mode 100644
index 0000000..2740713
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_HUGETLB_HPP__
+#define __CGROUPS_ISOLATOR_SUBSYSTEMS_HUGETLB_HPP__
+
+#include <string>
+
+#include <process/owned.hpp>
+
+#include <stout/try.hpp>
+
+#include "slave/flags.hpp"
+
+#include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+/**
+ * Represent cgroups hugetlb subsystem.
+ */
+class HugetlbSubsystem : public Subsystem
+{
+public:
+  static Try<process::Owned<Subsystem>> create(
+      const Flags& flags,
+      const std::string& hierarchy);
+
+  virtual ~HugetlbSubsystem() {}
+
+  virtual std::string name() const
+  {
+    return CGROUP_SUBSYSTEM_HUGETLB_NAME;
+  };
+
+private:
+  HugetlbSubsystem(const Flags& flags, const std::string& hierarchy);
+};
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {
+
+#endif // __CGROUPS_ISOLATOR_SUBSYSTEMS_HUGETLB_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp
new file mode 100644
index 0000000..060556b
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <process/id.hpp>
+
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp"
+
+using process::Owned;
+
+using std::string;
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+Try<Owned<Subsystem>> NetPrioSubsystem::create(
+    const Flags& flags,
+    const string& hierarchy)
+{
+  return Owned<Subsystem>(new NetPrioSubsystem(flags, hierarchy));
+}
+
+
+NetPrioSubsystem::NetPrioSubsystem(
+    const Flags& _flags,
+    const string& _hierarchy)
+  : ProcessBase(process::ID::generate("cgroups-net-prio-subsystem")),
+    Subsystem(_flags, _hierarchy) {}
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp
new file mode 100644
index 0000000..002c689
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_NET_PRIO_HPP__
+#define __CGROUPS_ISOLATOR_SUBSYSTEMS_NET_PRIO_HPP__
+
+#include <string>
+
+#include <process/owned.hpp>
+
+#include <stout/try.hpp>
+
+#include "slave/flags.hpp"
+
+#include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+/**
+ * Represent cgroups net_prio subsystem.
+ */
+class NetPrioSubsystem : public Subsystem
+{
+public:
+  static Try<process::Owned<Subsystem>> create(
+      const Flags& flags,
+      const std::string& hierarchy);
+
+  virtual ~NetPrioSubsystem() {}
+
+  virtual std::string name() const
+  {
+    return CGROUP_SUBSYSTEM_NET_PRIO_NAME;
+  };
+
+private:
+  NetPrioSubsystem(const Flags& flags, const std::string& hierarchy);
+};
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {
+
+#endif // __CGROUPS_ISOLATOR_SUBSYSTEMS_NET_PRIO_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp
new file mode 100644
index 0000000..42fea60
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <process/id.hpp>
+
+#include "slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp"
+
+using process::Owned;
+
+using std::string;
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+Try<Owned<Subsystem>> PidsSubsystem::create(
+    const Flags& flags,
+    const string& hierarchy)
+{
+  return Owned<Subsystem>(new PidsSubsystem(flags, hierarchy));
+}
+
+
+PidsSubsystem::PidsSubsystem(
+    const Flags& _flags,
+    const string& _hierarchy)
+  : ProcessBase(process::ID::generate("cgroups-pids-subsystem")),
+    Subsystem(_flags, _hierarchy) {}
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b495fda0/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp
new file mode 100644
index 0000000..cb6c919
--- /dev/null
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_PIDS_HPP__
+#define __CGROUPS_ISOLATOR_SUBSYSTEMS_PIDS_HPP__
+
+#include <string>
+
+#include <process/owned.hpp>
+
+#include <stout/try.hpp>
+
+#include "slave/flags.hpp"
+
+#include "slave/containerizer/mesos/isolators/cgroups/constants.hpp"
+#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp"
+
+namespace mesos {
+namespace internal {
+namespace slave {
+
+/**
+ * Represent cgroups pids subsystem.
+ */
+class PidsSubsystem : public Subsystem
+{
+public:
+  static Try<process::Owned<Subsystem>> create(
+      const Flags& flags,
+      const std::string& hierarchy);
+
+  virtual ~PidsSubsystem() {}
+
+  virtual std::string name() const
+  {
+    return CGROUP_SUBSYSTEM_PIDS_NAME;
+  };
+
+private:
+  PidsSubsystem(const Flags& flags, const std::string& hierarchy);
+};
+
+} // namespace slave {
+} // namespace internal {
+} // namespace mesos {
+
+#endif // __CGROUPS_ISOLATOR_SUBSYSTEMS_PIDS_HPP__