Exemplo n.º 1
0
def preprocess_ts(taskset, clusts, oheads):
    for clust in clusts:
        charge_spinlock_overheads(oheads, clust)
        for task in clust:
            #Initially assume completion by deadline and use G-FL
            task.response_time = task.deadline
            task.prio_pt = task.deadline - \
                           (clust.cpus - 1) / (clust.cpus) * task.cost
    assign_prio_pt_preemption_levels(taskset)
Exemplo n.º 2
0
def preprocess_ts(taskset, clusts, oheads):
    for clust in clusts:
        charge_spinlock_overheads(oheads, clust)
        for task in clust:
            #Initially assume completion by deadline and use G-FL
            task.response_time = task.deadline
            task.prio_pt = task.deadline - \
                           (clust.cpus - 1) / (clust.cpus) * task.cost
    assign_prio_pt_preemption_levels(taskset)
Exemplo n.º 3
0
    def test_spinlock(self):
        self.oheads()
        self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts), self.ts)
        self.unchanged_period()
        self.unchanged_deadline()
        self.not_lossy()

        scost = 17 + 19
        rcost = 7 + 11
        wcost = 3 + 5

        self.assertEqual(self.ts[0].cost, 10000 + 2 * wcost + 4 * rcost + 6 * scost)
        self.assertEqual(self.ts[1].cost,  5000 + 3 * wcost + 1 * rcost + 4 * scost)

        self.assertEqual(self.ts[0].resmodel[0].max_read_length,   0)
        self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + wcost)
        self.assertEqual(self.ts[1].resmodel[0].max_read_length,   0)
        self.assertEqual(self.ts[1].resmodel[0].max_write_length, 17 + wcost)

        self.assertEqual(self.ts[0].resmodel[1].max_read_length,  11 + rcost)
        self.assertEqual(self.ts[0].resmodel[1].max_write_length,  0)
        self.assertEqual(self.ts[1].resmodel[1].max_read_length,  17 + rcost)
        self.assertEqual(self.ts[1].resmodel[1].max_write_length,  0)

        self.assertEqual(self.ts[0].resmodel[2].max_read_length,  11 + rcost)
        self.assertEqual(self.ts[0].resmodel[2].max_write_length,  0)
        self.assertEqual(self.ts[1].resmodel[2].max_read_length,   0)
        self.assertEqual(self.ts[1].resmodel[2].max_write_length, 17 + wcost)
Exemplo n.º 4
0
 def test_spinlock_zero(self):
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts), self.ts)
     self.unchanged_period()
     self.unchanged_deadline()
     self.unchanged_cost()
     self.not_lossy()
     self.unchanged_resmodel()
Exemplo n.º 5
0
    def test_spinlock(self):
        self.oheads()
        self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts),
                      self.ts)
        self.unchanged_period()
        self.unchanged_deadline()
        self.not_lossy()

        scost = 17 + 19
        rcost = 7 + 11
        wcost = 3 + 5

        self.assertEqual(self.ts[0].cost,
                         10000 + 2 * wcost + 4 * rcost + 6 * scost)
        self.assertEqual(self.ts[1].cost,
                         5000 + 3 * wcost + 1 * rcost + 4 * scost)

        self.assertEqual(self.ts[0].resmodel[0].max_read_length, 0)
        self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + wcost)
        self.assertEqual(self.ts[1].resmodel[0].max_read_length, 0)
        self.assertEqual(self.ts[1].resmodel[0].max_write_length, 17 + wcost)

        self.assertEqual(self.ts[0].resmodel[1].max_read_length, 11 + rcost)
        self.assertEqual(self.ts[0].resmodel[1].max_write_length, 0)
        self.assertEqual(self.ts[1].resmodel[1].max_read_length, 17 + rcost)
        self.assertEqual(self.ts[1].resmodel[1].max_write_length, 0)

        self.assertEqual(self.ts[0].resmodel[2].max_read_length, 11 + rcost)
        self.assertEqual(self.ts[0].resmodel[2].max_write_length, 0)
        self.assertEqual(self.ts[1].resmodel[2].max_read_length, 0)
        self.assertEqual(self.ts[1].resmodel[2].max_write_length, 17 + wcost)
Exemplo n.º 6
0
 def test_spinlock_zero(self):
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts),
                   self.ts)
     self.unchanged_period()
     self.unchanged_deadline()
     self.unchanged_cost()
     self.not_lossy()
     self.unchanged_resmodel()
Exemplo n.º 7
0
 def test_spinlock_integral(self):
     self.o.lock = const(1.75)
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts), self.ts)
     self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + 2)
Exemplo n.º 8
0
 def test_spinlock_infeasible(self):
     self.o.syscall_in = const(10000000)
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts), False)
Exemplo n.º 9
0
 def test_spinlock_integral(self):
     self.o.lock = const(1.75)
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts),
                   self.ts)
     self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + 2)
Exemplo n.º 10
0
 def test_spinlock_infeasible(self):
     self.o.syscall_in = const(10000000)
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts),
                   False)