aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-09-22 17:18:07 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-09-22 17:18:07 -0400
commit44c034799bb7a4e8090b5460e36c3993d1924006 (patch)
tree4a1299358bf7effd2745c0e14bc49e52c67ac197 /include/litmus
parentf49ec60b4d6394cf199837bbe4c10258e5a877c7 (diff)
parent870eaa144c59ee2665b70dcbb9d8649e99e3c0c4 (diff)
Merge branch 'wip-edf-wm' into wip-semi-part
This version of litmus2010 contains the implementation of three semi-partitioned scheduling algorithms: EDF-fm, EDF-WM, and NPS-F. Conflicts: include/litmus/rt_param.h litmus/Makefile
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/rt_domain.h16
-rw-r--r--include/litmus/rt_param.h66
2 files changed, 72 insertions, 10 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h
index 59e6b54e9281..ac249292e866 100644
--- a/include/litmus/rt_domain.h
+++ b/include/litmus/rt_domain.h
@@ -143,12 +143,26 @@ static inline struct task_struct* take_ready(rt_domain_t* rt)
143static inline void add_release(rt_domain_t* rt, struct task_struct *task) 143static inline void add_release(rt_domain_t* rt, struct task_struct *task)
144{ 144{
145 unsigned long flags; 145 unsigned long flags;
146 /* first we need the write lock for rt_ready_queue */
147 raw_spin_lock_irqsave(&rt->tobe_lock, flags); 146 raw_spin_lock_irqsave(&rt->tobe_lock, flags);
148 __add_release(rt, task); 147 __add_release(rt, task);
149 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags); 148 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags);
150} 149}
151 150
151#ifdef CONFIG_RELEASE_MASTER
152void __add_release_on(rt_domain_t* rt, struct task_struct *task,
153 int target_cpu);
154
155static inline void add_release_on(rt_domain_t* rt,
156 struct task_struct *task,
157 int target_cpu)
158{
159 unsigned long flags;
160 raw_spin_lock_irqsave(&rt->tobe_lock, flags);
161 __add_release_on(rt, task, target_cpu);
162 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags);
163}
164#endif
165
152static inline int __jobs_pending(rt_domain_t* rt) 166static inline int __jobs_pending(rt_domain_t* rt)
153{ 167{
154 return !bheap_empty(&rt->ready_queue); 168 return !bheap_empty(&rt->ready_queue);
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index be8f5528ff87..6f43deacb3e1 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -1,3 +1,5 @@
1#include <linux/threads.h>
2
1/* 3/*
2 * Definition of the scheduler plugin interface. 4 * Definition of the scheduler plugin interface.
3 * 5 *
@@ -34,7 +36,7 @@ typedef enum {
34} budget_policy_t; 36} budget_policy_t;
35 37
36 38
37/* Parameters for EDF-Fm scheduling algorithm. 39/* The parameters for EDF-Fm scheduling algorithm.
38 * Each task may be fixed or migratory. Migratory tasks may 40 * Each task may be fixed or migratory. Migratory tasks may
39 * migrate on 2 (contiguous) CPU only. NR_CPUS_EDF_FM = 2. 41 * migrate on 2 (contiguous) CPU only. NR_CPUS_EDF_FM = 2.
40 */ 42 */
@@ -58,7 +60,7 @@ struct edffm_params {
58 lt_t fraction[2][NR_CPUS_EDF_FM]; 60 lt_t fraction[2][NR_CPUS_EDF_FM];
59}; 61};
60 62
61/* NPS-F semi-part. plugin. 63/* Parameters for NPS-F semi-partitioned scheduling algorithm.
62 * Each (cpu, budget) entry defines the share ('budget' in ns, a % of 64 * Each (cpu, budget) entry defines the share ('budget' in ns, a % of
63 * the slot_length) of the notional processor on the CPU 'cpu'. 65 * the slot_length) of the notional processor on the CPU 'cpu'.
64 * This structure is used by the library - syscall interface in order 66 * This structure is used by the library - syscall interface in order
@@ -69,6 +71,36 @@ struct npsf_budgets {
69 lt_t budget; 71 lt_t budget;
70}; 72};
71 73
74/* The parameters for the EDF-WM semi-partitioned scheduler.
75 * Each task may be split across multiple cpus. Each per-cpu allocation
76 * is called a 'slice'.
77 */
78#define MAX_EDF_WM_SLICES 24
79#define MIN_EDF_WM_SLICE_SIZE 50000 /* .05 millisecond = 50us */
80
81struct edf_wm_slice {
82 /* on which CPU is this slice allocated */
83 unsigned int cpu;
84 /* relative deadline from job release (not from slice release!) */
85 lt_t deadline;
86 /* budget of this slice; must be precisely enforced */
87 lt_t budget;
88 /* offset of this slice relative to the job release */
89 lt_t offset;
90};
91
92/* If a job is not sliced across multiple CPUs, then
93 * count is set to zero and none of the slices is used.
94 * This implies that count == 1 is illegal.
95 */
96struct edf_wm_params {
97 /* enumeration of all slices */
98 struct edf_wm_slice slices[MAX_EDF_WM_SLICES];
99
100 /* how many slices are defined? */
101 unsigned int count;
102};
103
72struct rt_task { 104struct rt_task {
73 lt_t exec_cost; 105 lt_t exec_cost;
74 lt_t period; 106 lt_t period;
@@ -81,11 +113,16 @@ struct rt_task {
81 union { 113 union {
82 /* EDF-Fm; defined in sched_edf_fm.c */ 114 /* EDF-Fm; defined in sched_edf_fm.c */
83 struct edffm_params fm; 115 struct edffm_params fm;
84 /* NPS-F: id for the server (notional processor) that holds 116
117 /* NPS-F; defined in sched_npsf.c
118 * id for the server (notional processor) that holds
85 * this task; the same npfs_id can be assigned to "the same" 119 * this task; the same npfs_id can be assigned to "the same"
86 * server split on different cpus 120 * server split on different cpus
87 * */ 121 */
88 int npsf_id; 122 int npsf_id;
123
124 /* EDF-WM; defined in sched_edf_wm.c */
125 struct edf_wm_params wm;
89 } semi_part; 126 } semi_part;
90}; 127};
91 128
@@ -234,12 +271,23 @@ struct rt_param {
234 271
235 /* runtime info for the semi-part plugins */ 272 /* runtime info for the semi-part plugins */
236 union { 273 union {
274 /* EDF-Fm runtime information
275 * number of jobs handled by this cpu
276 * (to determine next cpu for a migrating task)
277 */
278 unsigned int cpu_job_no[NR_CPUS_EDF_FM];
279
280 /* EDF-WM runtime information */
237 struct { 281 struct {
238 /* EDF-fm: number of jobs handled by this cpu 282 /* at which exec time did the current slice start? */
239 * (to determine next cpu for a migrating task) 283 lt_t exec_time;
240 */ 284 /* when did the job suspend? */
241 unsigned int cpu_job_no[NR_CPUS_EDF_FM]; 285 lt_t suspend_time;
242 } fm; 286 /* cached job parameters */
287 lt_t job_release, job_deadline;
288 /* pointer to the current slice */
289 struct edf_wm_slice* slice;
290 } wm;
243 } semi_part; 291 } semi_part;
244}; 292};
245 293