diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-09-21 22:22:10 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-09-22 15:18:53 -0400 |
commit | 06b23f7b33c61cf1f03acb2d19ddf5dc6c57a810 (patch) | |
tree | 7154b56b91b08387835089604709ec34d9b7d21c /include/litmus/rt_param.h | |
parent | 844cba1fd1189a755e60317a3f2b4403e7908b5b (diff) |
Remove EDF-Fm specific parameters from rt_param.h
Move parameters specific to EDF-Fm plugin only inside a dedicated data
structure. Use union within rt_task to merge also the other semi-part
plugins.
Diffstat (limited to 'include/litmus/rt_param.h')
-rw-r--r-- | include/litmus/rt_param.h | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 1c63b006f50e..90685e93ad21 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -20,9 +20,6 @@ static inline int lt_after_eq(lt_t a, lt_t b) | |||
20 | } | 20 | } |
21 | #define lt_before_eq(a, b) lt_after_eq(b, a) | 21 | #define lt_before_eq(a, b) lt_after_eq(b, a) |
22 | 22 | ||
23 | #define NR_CPUS_EDF_FM 2 | ||
24 | #define NR_CPUS_SEMI NR_CPUS_EDF_FM | ||
25 | |||
26 | /* different types of clients */ | 23 | /* different types of clients */ |
27 | typedef enum { | 24 | typedef enum { |
28 | RT_CLASS_HARD, | 25 | RT_CLASS_HARD, |
@@ -36,6 +33,31 @@ typedef enum { | |||
36 | PRECISE_ENFORCEMENT /* NOT IMPLEMENTED - enforced with hrtimers */ | 33 | PRECISE_ENFORCEMENT /* NOT IMPLEMENTED - enforced with hrtimers */ |
37 | } budget_policy_t; | 34 | } budget_policy_t; |
38 | 35 | ||
36 | |||
37 | /* Parameters for EDF-Fm scheduling algorithm. | ||
38 | * Each task may be fixed or migratory. Migratory tasks may | ||
39 | * migrate on 2 (contiguous) CPU only. NR_CPUS_EDF_FM = 2. | ||
40 | */ | ||
41 | #define NR_CPUS_EDF_FM 2 | ||
42 | |||
43 | struct edffm_params { | ||
44 | /* EDF-fm where can a migratory task execute? */ | ||
45 | unsigned int cpus[NR_CPUS_EDF_FM]; | ||
46 | /* how many cpus are used by this task? | ||
47 | * fixed = 0, migratory = (NR_CPUS_EDF_FM - 1) | ||
48 | * Efficient way to allow writing cpus[nr_cpus]. | ||
49 | */ | ||
50 | unsigned int nr_cpus; | ||
51 | /* Fraction of this task exec_cost that each CPU should handle. | ||
52 | * We keep the fraction divided in num/denom : a matrix of | ||
53 | * (NR_CPUS_EDF_FM rows) x (2 columns). | ||
54 | * The first column is the numerator of the fraction. | ||
55 | * The second column is the denominator. | ||
56 | * In EDF-fm this is a 2*2 matrix | ||
57 | */ | ||
58 | lt_t fraction[2][NR_CPUS_EDF_FM]; | ||
59 | }; | ||
60 | |||
39 | struct rt_task { | 61 | struct rt_task { |
40 | lt_t exec_cost; | 62 | lt_t exec_cost; |
41 | lt_t period; | 63 | lt_t period; |
@@ -43,21 +65,12 @@ struct rt_task { | |||
43 | unsigned int cpu; | 65 | unsigned int cpu; |
44 | task_class_t cls; | 66 | task_class_t cls; |
45 | budget_policy_t budget_policy; /* ignored by pfair */ | 67 | budget_policy_t budget_policy; /* ignored by pfair */ |
46 | /* EDF-fm where can a migrat task execute? */ | 68 | |
47 | unsigned int cpus[NR_CPUS_SEMI]; | 69 | /* parameters used by the semi-partitioned algorithms */ |
48 | /* how many cpus are used by this task? fixed = 0, migrat = multi | 70 | union { |
49 | * nr_cpus = (number of cpu where the task can be migrated) - 1 | 71 | /* EDF-Fm; defined in sched_edf_fm.c */ |
50 | * so that one can use: cpus[nr_cpus] | 72 | struct edffm_params fm; |
51 | */ | 73 | } semi_part; |
52 | unsigned int nr_cpus; | ||
53 | /* EDF-fm migrating tasks, fraction of this task exec_cost | ||
54 | * that the processors should handle. | ||
55 | * We keep the fraction divided in num/denom : a matrix of | ||
56 | * NR_CPUS_SEMI rows * 2 columns; first column is the numerator | ||
57 | * of the fraction, second column is the denominator | ||
58 | * (in EDF-fm this is a 2*2 matrix) | ||
59 | */ | ||
60 | lt_t fraction[2][NR_CPUS_SEMI]; | ||
61 | }; | 74 | }; |
62 | 75 | ||
63 | /* The definition of the data that is shared between the kernel and real-time | 76 | /* The definition of the data that is shared between the kernel and real-time |
@@ -108,11 +121,6 @@ struct rt_job { | |||
108 | * Increase this sequence number when a job is released. | 121 | * Increase this sequence number when a job is released. |
109 | */ | 122 | */ |
110 | unsigned int job_no; | 123 | unsigned int job_no; |
111 | |||
112 | /* EDF-fm: number of jobs handled by this cpu | ||
113 | * (to determine next cpu for a migrating task) | ||
114 | */ | ||
115 | unsigned int cpu_job_no[NR_CPUS_SEMI]; | ||
116 | }; | 124 | }; |
117 | 125 | ||
118 | struct pfair_param; | 126 | struct pfair_param; |
@@ -207,6 +215,16 @@ struct rt_param { | |||
207 | 215 | ||
208 | /* Pointer to the page shared between userspace and kernel. */ | 216 | /* Pointer to the page shared between userspace and kernel. */ |
209 | struct control_page * ctrl_page; | 217 | struct control_page * ctrl_page; |
218 | |||
219 | /* runtime info for the semi-part plugins */ | ||
220 | union { | ||
221 | struct { | ||
222 | /* EDF-fm: number of jobs handled by this cpu | ||
223 | * (to determine next cpu for a migrating task) | ||
224 | */ | ||
225 | unsigned int cpu_job_no[NR_CPUS_EDF_FM]; | ||
226 | } fm; | ||
227 | } semi_part; | ||
210 | }; | 228 | }; |
211 | 229 | ||
212 | /* Possible RT flags */ | 230 | /* Possible RT flags */ |