summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-03-29 10:06:16 +0200
committerSven Eden <yamakuzure@gmx.net>2017-03-29 10:48:15 +0200
commitfdff7397c22a853e7e66ec72adb85c3f2f519f32 (patch)
tree8a47f1b1aba281c075c8f76b5d0e90973958c443 /src/core/cgroup.h
parent64b485bf89b90042c9a624633b038ef417b0325e (diff)
[3/5] Apply missing fixes from upstream
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index be882a0b6..29782c58c 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -32,6 +32,16 @@
// UNNEEDED typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight;
// UNNEEDED typedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth;
+/* Maximum value for fixed (manual) net class ID assignment,
+ * and also the value at which the range of automatic assignments starts
+ */
+// UNNEEDED #define CGROUP_NETCLASS_FIXED_MAX UINT32_C(65535)
+
+// UNNEEDED typedef struct CGroupContext CGroupContext;
+// UNNEEDED typedef struct CGroupDeviceAllow CGroupDeviceAllow;
+// UNNEEDED typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight;
+// UNNEEDED typedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth;
+
/// UNNEEDED by elogind
#if 0
typedef enum CGroupDevicePolicy {
@@ -50,6 +60,17 @@ typedef enum CGroupDevicePolicy {
_CGROUP_DEVICE_POLICY_INVALID = -1
} CGroupDevicePolicy;
+typedef enum CGroupNetClassType {
+ /* Default - do not assign a net class */
+ CGROUP_NETCLASS_TYPE_NONE,
+
+ /* Automatically assign a net class */
+ CGROUP_NETCLASS_TYPE_AUTO,
+
+ /* Assign the net class that was provided by the user */
+ CGROUP_NETCLASS_TYPE_FIXED,
+} CGroupNetClassType;
+
struct CGroupDeviceAllow {
LIST_FIELDS(CGroupDeviceAllow, device_allow);
char *path;
@@ -61,7 +82,7 @@ struct CGroupDeviceAllow {
struct CGroupBlockIODeviceWeight {
LIST_FIELDS(CGroupBlockIODeviceWeight, device_weights);
char *path;
- unsigned long weight;
+ uint64_t weight;
};
struct CGroupBlockIODeviceBandwidth {
@@ -76,12 +97,12 @@ struct CGroupContext {
bool blockio_accounting;
bool memory_accounting;
- unsigned long cpu_shares;
- unsigned long startup_cpu_shares;
+ uint64_t cpu_shares;
+ uint64_t startup_cpu_shares;
usec_t cpu_quota_per_sec_usec;
- unsigned long blockio_weight;
- unsigned long startup_blockio_weight;
+ uint64_t blockio_weight;
+ uint64_t startup_blockio_weight;
LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights);
LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths);
@@ -90,6 +111,11 @@ struct CGroupContext {
CGroupDevicePolicy device_policy;
LIST_HEAD(CGroupDeviceAllow, device_allow);
+ CGroupNetClassType netclass_type;
+ uint32_t netclass_id;
+
+ uint64_t tasks_max;
+
bool delegate;
};
#endif // 0
@@ -128,6 +154,9 @@ struct CGroupContext {
// UNNEEDED int unit_attach_pids_to_cgroup(Unit *u);
+// UNNEEDED int unit_add_to_netclass_cgroup(Unit *u);
+// UNNEEDED int unit_remove_from_netclass_cgroup(Unit *u);
+
int manager_setup_cgroup(Manager *m);
void manager_shutdown_cgroup(Manager *m, bool delete);
@@ -141,6 +170,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete);
// UNNEEDED int unit_watch_all_pids(Unit *u);
// UNNEEDED int unit_get_memory_current(Unit *u, uint64_t *ret);
+// UNNEEDED int unit_get_tasks_current(Unit *u, uint64_t *ret);
// UNNEEDED int unit_get_cpu_usage(Unit *u, nsec_t *ret);
// UNNEEDED int unit_reset_cpu_usage(Unit *u);
@@ -149,5 +179,9 @@ void manager_shutdown_cgroup(Manager *m, bool delete);
// UNNEEDED int unit_notify_cgroup_empty(Unit *u);
// UNNEEDED int manager_notify_cgroup_empty(Manager *m, const char *group);
+// UNNEEDED void unit_invalidate_cgroup(Unit *u, CGroupMask m);
+
+// UNNEEDED void manager_invalidate_startup_units(Manager *m);
+
// UNNEEDED const char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_;
// UNNEEDED CGroupDevicePolicy cgroup_device_policy_from_string(const char *s) _pure_;