From 5fa9c02433d78f99c25947035fb3d9fa4ec65c84 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 9 Mar 2018 18:12:06 +0000 Subject: [PATCH 1/2] load_tracking.py: Shorten ASCII art group graphs Make ASCII art graphs shorter by removing some "/". --- tests/eas/load_tracking.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/eas/load_tracking.py b/tests/eas/load_tracking.py index 578ce9be5..04c5c9879 100644 --- a/tests/eas/load_tracking.py +++ b/tests/eas/load_tracking.py @@ -1085,17 +1085,14 @@ class TwoGroupsCascade(_PELTTaskGroupsTest): +-----+ | "/" | +-----+ - / \ / \ +------+ t0_1 |"/tg1"| +------+ - / \ / \ t1_1 +------------+ |"/tg1/tg1_1"| +------------+ - / \ / \ t2_1 t2_2 @@ -1180,27 +1177,22 @@ class UnbalancedHierarchy(_PELTTaskGroupsTest): +-----+ | "/" | +-----+ - / \ / \ +------+ t0_1 |"/tg1"| +------+ / - / +----------+ |"/tg1/tg2"| +----------+ - / \ / \ +--------------+ t2_1 |"/tg1/tg2/tg3"| +--------------+ / - / +------------------+ |"/tg1/tg2/tg3/tg4"| +------------------+ - / / t4_1 -- GitLab From c234439f7188cc1a268e84b98ff94af059227d8e Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 14 Mar 2018 18:07:31 +0000 Subject: [PATCH 2/2] load_tracking.py: Fix _test_group_util for root The root group contains more tasks than what we expect (the non-frozen tasks). Therefore, we cannot compute the expected upper bound on its utilization, and the test will fail often. Relax this test by only checking the expected lower utilization bound for the root group. --- tests/eas/load_tracking.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/eas/load_tracking.py b/tests/eas/load_tracking.py index 04c5c9879..93d5d62a9 100644 --- a/tests/eas/load_tracking.py +++ b/tests/eas/load_tracking.py @@ -1004,7 +1004,7 @@ class _PELTTaskGroupsTest(LisaTest): def _migrate_task(cls, test_env): return - def _test_group_util(self, group): + def _test_group_util(self, group, test_upper_bound=True): if 'sched_load_se' not in self.trace.available_events: raise ValueError('No sched_load_se events. ' 'Does the kernel support them?') @@ -1071,12 +1071,17 @@ class _PELTTaskGroupsTest(LisaTest): expected_trace_util += util_mean + msg = msg.format(util_mean_tg, group, expected_trace_util) error_margin = expected_trace_util * self.allowed_util_margin - self.assertAlmostEqual(util_mean_tg, expected_trace_util, - delta=error_margin, - msg=msg.format(util_mean_tg, - group, - expected_trace_util)) + # The root group contains more tasks than what we expect, since + # non-frozen tasks are executing there, so we cannot check for an upper + # bound on its utilization. + if test_upper_bound: + self.assertAlmostEqual(util_mean_tg, expected_trace_util, + delta=error_margin, msg=msg) + else: + lower_bound = expected_trace_util - error_margin + self.assertGreaterEqual(util_mean_tg, lower_bound, msg=msg) class TwoGroupsCascade(_PELTTaskGroupsTest): """ @@ -1156,7 +1161,7 @@ class TwoGroupsCascade(_PELTTaskGroupsTest): """ Test utilization propagation to cgroup root """ - return self._test_group_util('/') + return self._test_group_util('/', test_upper_bound=False) def test_util_tg1_group(self): """ @@ -1256,7 +1261,7 @@ class UnbalancedHierarchy(_PELTTaskGroupsTest): """ Test utilization propagation to cgroup root """ - return self._test_group_util('/') + return self._test_group_util('/', test_upper_bound=False) def test_util_tg1_group(self): """ @@ -1369,7 +1374,7 @@ class CgroupsMigrationTest(_PELTTaskGroupsTest): def test_group_util_aggregation(self): """Test the aggregated tasks utilization at the root""" - return self._test_group_util('/') + return self._test_group_util('/', test_upper_bound=False) def test_group_util_move_out(self): """Test utilization update when a task leaves a group""" @@ -1471,7 +1476,7 @@ class NestedCgroupsMigrationTest(_PELTTaskGroupsTest): def test_group_util_aggregation(self): """Test the aggregated tasks utilization at the root""" - return self._test_group_util('/') + return self._test_group_util('/', test_upper_bound=False) def test_group_util_move_in(self): """Test utilization update when a task enters a group""" -- GitLab