jlelli / sched-deadline-archive

An implementation of the popular Earliest Deadline First (EDF) scheduling algorithm or the Linux kernel. It is still experimental code, and it is still continuously being improved, but it already is a fully-working solution for supporting typical real-time applications in GNU/Linux environments.
Other
49 stars 31 forks source link

SCHED_DEADLINE sched_setattr: Invalid argument #11

Open rcald008 opened 9 years ago

rcald008 commented 9 years ago

I have been trying to configure the SCHED_DEADLINE policy exactly like so:

    {
          "resources" : 4,
          "tasks" : {
              "thread0" : {
                     "exec" : 1000,
                     "period" : 10000,
                     "deadline" : 8000,
                  "priority": 20,
                     "cpus" : [0,1],
                     "policy" : "SCHED_DEADLINE",
                     "lock_order" : [0],
                     "resources" : {
                     "0" : { "duration" : 1000 }
                     }
              },
              "thread1" : {
                     "exec" : 50000,
                     "period" : 100000,
                     "cpus" : [1],
                     "policy" : "SCHED_DEADLINE",
                     "priority": 20,
                     "lock_order" : [ 0, 3, 2 ],
                     "resources": {
                     "0" : { "duration" : 1000, "access": [2] },
                     "1" : { "duration" : 100, "access": [3] },
                     "2" : { "duration" : 200, "access": [1] },
                     "3" : { "duration" : 500}
                     }
              }
          },
          "global" : {
              "spacing" : 1000,
              "default_policy" : "SCHED_DEADLINE",
              "duration" : 20,
              "gnuplot" : true,
              "logdir" : "/tmp/",
              "log_basename" : "rt-app",
              "lock_pages" : true,
              "frag" : 1
          }
    }

I have also tried configuring through the command line in the fashion that Part 4 specifies in: https://github.com/jlelli/sched-deadline/blob/sched-dl-V9-review/Documentation/scheduler/sched-deadline.txt

mkdir /dev/cpuset mount -t cgroup -o cpuset cpuset /dev/cpuset cd /dev/cpuset mkdir cpu0 echo 0 > cpu0/cpuset.cpus echo 0 > cpu0/cpuset.mems echo 1 > cpuset.cpu_exclusive echo 0 > cpuset.sched_load_balance echo 1 > cpu0/cpuset.cpu_exclusive echo 1 > cpu0/cpuset.mem_exclusive echo $$ > cpu0/tasks rt-app -t 100000:10000:d:0 -D5 (it is now actually superfluous to specify task affinity)

However I see the following error: [rt-app] [0] setting cpu affinity to CPU(s) [ 0, 1 ] [rt-app] [0] Using SCHED_DEADLINE policy: [rt-app] [0] Locking pages in memory [rt-app] [1] setting cpu affinity to CPU(s) [ 1 ] [rt-app] [1] Using SCHED_DEADLINE policy: [rt-app] [0] Waiting 1000 usecs... [rt-app] [1] Locking pages in memory [rt-app] [1] Waiting 2000 usecs... [rt-app] [0] Starting... [rt-app] [0] starting thread with period: 10000, exec: 1050,deadline: 10000, priority: 0 [rt-app] [0] sched_setattr returned -1 sched_setattr: Invalid argument

Similarly through the command line: root@rcald008-OptiPlex-780:/dev/cpuset# sudo rt-app -t 100000:10000:d:0 -D5 [rt-app] [0] setting cpu affinity to CPU(s) 0 [rt-app] [0] Using SCHED_DEADLINE policy: Policy : SCHED_DEADLINE

[rt-app] [0] Locking pages in memory

idx period min_et max_et rel_st start end

deadline dur. slack Budget Used Budget [rt-app] [0] starting thread with period: 100000, exec: 10500,deadline: 100000, priority: 0 [rt-app] [0] sched_setattr returned -1 sched_setattr: Invalid argument

I am using the sched-dl-V9-rebase version (branch). Any help would be greatly appreciated. Thank you very much for your time.

rcald008 commented 9 years ago

One thing to note, my execution time when output to the screen after running rt-app is different from what was specified in the json file. Not sure why this is happening.