Apache Mesos
constants.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __CGROUPS_ISOLATOR_CONSTANTS_HPP__
18 #define __CGROUPS_ISOLATOR_CONSTANTS_HPP__
19 
20 #include <string>
21 
22 #include <stout/bytes.hpp>
23 #include <stout/duration.hpp>
24 
25 namespace mesos {
26 namespace internal {
27 namespace slave {
28 
29 // CPU subsystem constants.
30 const uint64_t CPU_SHARES_PER_CPU = 1024;
31 const uint64_t CPU_SHARES_PER_CPU_REVOCABLE = 10;
32 const uint64_t MIN_CPU_SHARES = 2; // Linux constant.
33 const Duration CPU_CFS_PERIOD = Milliseconds(100); // Linux default.
35 
36 
37 // Memory subsystem constants.
39 
40 
41 // Subsystem names.
42 const std::string CGROUP_SUBSYSTEM_BLKIO_NAME = "blkio";
43 const std::string CGROUP_SUBSYSTEM_CPU_NAME = "cpu";
44 const std::string CGROUP_SUBSYSTEM_CPUACCT_NAME = "cpuacct";
45 const std::string CGROUP_SUBSYSTEM_CPUSET_NAME = "cpuset";
46 const std::string CGROUP_SUBSYSTEM_DEVICES_NAME = "devices";
47 const std::string CGROUP_SUBSYSTEM_HUGETLB_NAME = "hugetlb";
48 const std::string CGROUP_SUBSYSTEM_MEMORY_NAME = "memory";
49 const std::string CGROUP_SUBSYSTEM_NET_CLS_NAME = "net_cls";
50 const std::string CGROUP_SUBSYSTEM_NET_PRIO_NAME = "net_prio";
51 const std::string CGROUP_SUBSYSTEM_PERF_EVENT_NAME = "perf_event";
52 const std::string CGROUP_SUBSYSTEM_PIDS_NAME = "pids";
53 
54 } // namespace slave {
55 } // namespace internal {
56 } // namespace mesos {
57 
58 #endif // __CGROUPS_ISOLATOR_CONSTANTS_HPP__
const std::string CGROUP_SUBSYSTEM_DEVICES_NAME
Definition: constants.hpp:46
const uint64_t CPU_SHARES_PER_CPU
Definition: constants.hpp:30
const std::string CGROUP_SUBSYSTEM_MEMORY_NAME
Definition: constants.hpp:48
const std::string CGROUP_SUBSYSTEM_PERF_EVENT_NAME
Definition: constants.hpp:51
const Duration CPU_CFS_PERIOD
Definition: constants.hpp:33
const std::string CGROUP_SUBSYSTEM_NET_CLS_NAME
Definition: constants.hpp:49
constexpr Bytes Megabytes(uint64_t value)
Definition: bytes.hpp:123
const std::string CGROUP_SUBSYSTEM_PIDS_NAME
Definition: constants.hpp:52
const std::string CGROUP_SUBSYSTEM_BLKIO_NAME
Definition: constants.hpp:42
Definition: duration.hpp:32
const uint64_t MIN_CPU_SHARES
Definition: constants.hpp:32
const std::string CGROUP_SUBSYSTEM_CPU_NAME
Definition: constants.hpp:43
Definition: duration.hpp:193
const std::string CGROUP_SUBSYSTEM_CPUACCT_NAME
Definition: constants.hpp:44
Definition: agent.hpp:25
const std::string CGROUP_SUBSYSTEM_NET_PRIO_NAME
Definition: constants.hpp:50
const std::string CGROUP_SUBSYSTEM_CPUSET_NAME
Definition: constants.hpp:45
Definition: attributes.hpp:24
const Bytes MIN_MEMORY
Definition: constants.hpp:38
Definition: bytes.hpp:30
const uint64_t CPU_SHARES_PER_CPU_REVOCABLE
Definition: constants.hpp:31
const Duration MIN_CPU_CFS_QUOTA
Definition: constants.hpp:34
const std::string CGROUP_SUBSYSTEM_HUGETLB_NAME
Definition: constants.hpp:47