summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorWaLyong Cho <walyong.cho@samsung.com>2014-05-16 00:09:34 +0900
committerLennart Poettering <lennart@poettering.net>2014-05-22 07:13:56 +0900
commit95ae05c0e79868c22b3e8e6fbc53432786876730 (patch)
tree874e9eb9902db34ded1e65ef88bbaf29d2f5aa4e /src/core/cgroup.h
parent7e4f9431caf4be39f39b64634f7708d7ca217d41 (diff)
downloadsystemd-95ae05c0e79868c22b3e8e6fbc53432786876730.tar.gz
core: add startup resource control option
Similar to CPUShares= and BlockIOWeight= respectively. However only assign the specified weight during startup. Each control group attribute is re-assigned as weight by CPUShares=weight and BlockIOWeight=weight after startup. If not CPUShares= or BlockIOWeight= be specified, then the attribute is re-assigned to each default attribute value. (default cpu.shares=1024, blkio.weight=1000) If only CPUShares=weight or BlockIOWeight=weight be specified, then that implies StartupCPUShares=weight and StartupBlockIOWeight=weight.
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 2b19add799..64d3ac64f5 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -71,11 +71,15 @@ struct CGroupContext {
bool memory_accounting;
unsigned long cpu_shares;
+ unsigned long startup_cpu_shares;
+ bool startup_cpu_shares_set:1;
usec_t cpu_quota_per_sec_usec;
usec_t cpu_quota_usec;
usec_t cpu_quota_period_usec;
unsigned long blockio_weight;
+ unsigned long startup_blockio_weight;
+ bool startup_blockio_weight_set:1;
LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights);
LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths);
@@ -92,9 +96,9 @@ struct CGroupContext {
void cgroup_context_init(CGroupContext *c);
void cgroup_context_done(CGroupContext *c);
void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix);
-void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const char *path);
+void cgroup_context_apply(Manager *m, CGroupContext *c, CGroupControllerMask mask, const char *path);
-CGroupControllerMask cgroup_context_get_mask(CGroupContext *c);
+CGroupControllerMask cgroup_context_get_mask(Manager *m, CGroupContext *c);
void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a);
void cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBlockIODeviceWeight *w);