diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-03 17:54:24 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-03 17:54:24 -0400 |
commit | 520525b6749f208bd90f25cb70cdf0b656b681bf (patch) | |
tree | ae235525294808c75f6cc86ce23d653d6fe993f9 | |
parent | 30ec11d932ed9317035d0e56c550ac1353911792 (diff) |
Use NR_CPUS_EDF_OS instead of NR_CPUS to allow proper interface with liblitmus
-rw-r--r-- | include/litmus/rt_param.h | 9 | ||||
-rw-r--r-- | litmus/sched_edf_os.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index d250e538a63e..bc3bbd07ef26 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -42,6 +42,7 @@ typedef enum { | |||
42 | * migrate on 2 (contiguous) CPU only. NR_CPUS_EDF_FM = 2. | 42 | * migrate on 2 (contiguous) CPU only. NR_CPUS_EDF_FM = 2. |
43 | */ | 43 | */ |
44 | #define NR_CPUS_EDF_FM 2 | 44 | #define NR_CPUS_EDF_FM 2 |
45 | #define NR_CPUS_EDF_OS 24 | ||
45 | 46 | ||
46 | struct edffm_params { | 47 | struct edffm_params { |
47 | /* EDF-fm where can a migratory task execute? */ | 48 | /* EDF-fm where can a migratory task execute? */ |
@@ -67,14 +68,14 @@ struct edfos_params { | |||
67 | /* Whether this task is a migrating task*/ | 68 | /* Whether this task is a migrating task*/ |
68 | unsigned int migrat; | 69 | unsigned int migrat; |
69 | /* Time of next subtask release or deadline */ | 70 | /* Time of next subtask release or deadline */ |
70 | int heap_data[NR_CPUS]; | 71 | int heap_data[NR_CPUS_EDF_OS]; |
71 | /* Fraction of this task exec_cost that each CPU should handle. | 72 | /* Fraction of this task exec_cost that each CPU should handle. |
72 | * We keep the fraction divided in num/denom : a matrix of | 73 | * We keep the fraction divided in num/denom : a matrix of |
73 | * (NR_CPUS rows) x (2 columns). | 74 | * (NR_CPUS_EDF_OS rows) x (2 columns). |
74 | * The first column is the numerator of the fraction. | 75 | * The first column is the numerator of the fraction. |
75 | * The second column is the denominator. | 76 | * The second column is the denominator. |
76 | */ | 77 | */ |
77 | lt_t fraction[NR_CPUS][2]; | 78 | lt_t fraction[NR_CPUS_EDF_OS][2]; |
78 | struct bheap release_queue; | 79 | struct bheap release_queue; |
79 | struct bheap ready_queue; | 80 | struct bheap ready_queue; |
80 | }; | 81 | }; |
@@ -297,7 +298,7 @@ struct rt_param { | |||
297 | * number of jobs handled by this cpu | 298 | * number of jobs handled by this cpu |
298 | * (to determine next cpu for a migrating task) | 299 | * (to determine next cpu for a migrating task) |
299 | */ | 300 | */ |
300 | unsigned int cpu_job_no[NR_CPUS]; | 301 | unsigned int cpu_job_no[NR_CPUS_EDF_OS]; |
301 | 302 | ||
302 | /* EDF-WM runtime information */ | 303 | /* EDF-WM runtime information */ |
303 | struct { | 304 | struct { |
diff --git a/litmus/sched_edf_os.c b/litmus/sched_edf_os.c index a4b3cdeb1a07..dac2f0e8ca3b 100644 --- a/litmus/sched_edf_os.c +++ b/litmus/sched_edf_os.c | |||
@@ -489,7 +489,7 @@ static void edfos_task_new(struct task_struct * t, int on_rq, int running) | |||
489 | if (edfos_params(t).migrat) { | 489 | if (edfos_params(t).migrat) { |
490 | bheap_init(&edfos_params(t).release_queue); | 490 | bheap_init(&edfos_params(t).release_queue); |
491 | bheap_init(&edfos_params(t).ready_queue); | 491 | bheap_init(&edfos_params(t).ready_queue); |
492 | for (i = 0; i < NR_CPUS; i++) { | 492 | for (i = 0; i < NR_CPUS_EDF_OS; i++) { |
493 | if (edfos_params(t).fraction[i][0] > 0) { | 493 | if (edfos_params(t).fraction[i][0] > 0) { |
494 | has_cpu = 1; | 494 | has_cpu = 1; |
495 | edfos_params(t).heap_data[i] = | 495 | edfos_params(t).heap_data[i] = |