def test_no_double_accounting_spin_sob(self): "test that s-oblivious spin delay and arrival blocking are correctly accounted for" lb.apply_task_fair_mutex_bounds(self.ts, 1) self.assertTrue(rta.is_schedulable(1, self.p0)) self.assertTrue(rta.is_schedulable(1, self.p1)) # Expected inflated WCET and response times: # - for highest-priority task: # - arrival blocking of up to 2ms # - spin blocking of up to 1ms self.assertEqual(self.p0[0].cost, 10 + 3) self.assertEqual(self.p1[0].cost, 10 + 3) self.assertEqual(self.p0[0].response_time, 10 + 2 + 1) self.assertEqual(self.p1[0].response_time, 10 + 2 + 1) # - for lower-priority task: # - no arrival blocking # - interference of up to 10ms + 3ms # - spin blocking of up to 1ms self.assertEqual(self.p0[1].cost, 10 + 1) self.assertEqual(self.p1[1].cost, 10 + 1) self.assertEqual(self.p0[1].response_time, 10 + 10 + 3 + 1) self.assertEqual(self.p1[1].response_time, 10 + 10 + 3 + 1)
def pfp_sched_test_msrp_inflate(taskset_in): ts = copy.deepcopy(taskset_in) partitions = defaultdict(tasks.TaskSystem) for t in ts: t.uninflated_cost = t.cost t.response_time = t.cost t.response_old = 0 partitions[t.partition].append(t) while not response_times_consistent(ts): for t in ts: t.cost = t.uninflated_cost assert t.response_time >= t.response_old # monotonicity t.response_old = t.response_time lb.apply_task_fair_mutex_bounds(ts, 1, pi_aware=True) for part in partitions: if not fp.is_schedulable(1, partitions[part]): return (False, ts) return (True, ts)
def bound_cfl_with_locks(tasks, clusts, oheads, cluster_size): preprocess_ts(tasks, clusts, oheads) completion_ok = False count = 0 while not completion_ok: completion_ok = True new_ts, new_clusts = copy_ts(tasks, clusts) count += 1 if count > 100: return False apply_task_fair_mutex_bounds(new_ts, cluster_size, 0) if not post_blocking_term_oh_inflation(oheads, new_clusts): return False for i, clust in enumerate(new_clusts): if not has_bounded_tardiness(clust.cpus, clust): return False bound_gfl_response_times(clust.cpus, clust, 15) for j, t in enumerate(clust): if t.response_time > clusts[i][j].response_time: completion_ok = False return new_clusts
def test_tfmtx(self): lb.apply_task_fair_mutex_bounds(self.ts, 2) self.sob_non_zero_blocking()