summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2021-12-10 19:00:45 +0100
committerMichal Koutný <mkoutny@suse.com>2022-01-10 18:22:41 +0100
commitd2bd0bfa362a26a8cd6e1d68e5c485f129fbb379 (patch)
tree453e7dee913ab63fe5c244ec821a7a42cfe43ae8 /src/core
parentcore/cgroup: Provide information about applied BFQ scaling (diff)
downloadsystemd-d2bd0bfa362a26a8cd6e1d68e5c485f129fbb379.tar.xz
systemd-d2bd0bfa362a26a8cd6e1d68e5c485f129fbb379.zip
cgroup-util: Move macros to macros and tests to tests
Friends to friends to be consistent with the other macros and make tests separate from main code.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cgroup.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 07d53b2fb6..81147733a3 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -45,12 +45,6 @@
#define CGROUP_CPU_QUOTA_DEFAULT_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC)
-/* Special values for the bfq.weight attribute */
-#define CGROUP_BFQ_WEIGHT_INVALID UINT64_MAX
-#define CGROUP_BFQ_WEIGHT_MIN UINT64_C(1)
-#define CGROUP_BFQ_WEIGHT_MAX UINT64_C(1000)
-#define CGROUP_BFQ_WEIGHT_DEFAULT UINT64_C(100)
-
/* Returns the log level to use when cgroup attribute writes fail. When an attribute is missing or we have access
* problems we downgrade to LOG_DEBUG. This is supposed to be nice to container managers and kernels which want to mask
* out specific attributes from us. */
@@ -1264,19 +1258,6 @@ static int cgroup_apply_devices(Unit *u) {
return r;
}
-/* Convert the normal io.weight value to io.bfq.weight */
-#define BFQ_WEIGHT(weight) \
- (weight <= CGROUP_WEIGHT_DEFAULT ? \
- CGROUP_BFQ_WEIGHT_DEFAULT - (CGROUP_WEIGHT_DEFAULT - weight) * (CGROUP_BFQ_WEIGHT_DEFAULT - CGROUP_BFQ_WEIGHT_MIN) / (CGROUP_WEIGHT_DEFAULT - CGROUP_WEIGHT_MIN) : \
- CGROUP_BFQ_WEIGHT_DEFAULT + (weight - CGROUP_WEIGHT_DEFAULT) * (CGROUP_BFQ_WEIGHT_MAX - CGROUP_BFQ_WEIGHT_DEFAULT) / (CGROUP_WEIGHT_MAX - CGROUP_WEIGHT_DEFAULT))
-
-assert_cc(BFQ_WEIGHT(1) == 1);
-assert_cc(BFQ_WEIGHT(50) == 50);
-assert_cc(BFQ_WEIGHT(100) == 100);
-assert_cc(BFQ_WEIGHT(500) == 136);
-assert_cc(BFQ_WEIGHT(5000) == 545);
-assert_cc(BFQ_WEIGHT(10000) == 1000);
-
static void set_io_weight(Unit *u, uint64_t weight) {
char buf[STRLEN("default \n")+DECIMAL_STR_MAX(uint64_t)];
uint64_t bfq_weight;