aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2011-09-26 23:55:48 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2011-09-26 23:55:48 -0400
commit46bb1ecb861729ebc3ac1631b6a7f7b131db86ac (patch)
treeda0192e8e171f44999d6c826886030f6ea03b36e /include
parentd9e964752ce668f8a9540e9511e0cb73cd21d480 (diff)
Checkpoint commit. Testing begins.
Diffstat (limited to 'include')
-rw-r--r--include/litmus/ce_domain.h23
-rw-r--r--include/litmus/sched_mc.h37
2 files changed, 45 insertions, 15 deletions
diff --git a/include/litmus/ce_domain.h b/include/litmus/ce_domain.h
new file mode 100644
index 000000000000..373f3f5f78d3
--- /dev/null
+++ b/include/litmus/ce_domain.h
@@ -0,0 +1,23 @@
1#ifndef _LITMUS_CE_DOMAIN_H
2#define _LITMUS_CE_DOMAIN_H
3
4/*
5 * Functions that the MC plugin needs to call through a domain pointer.
6 */
7void ce_requeue(domain_t*, struct task_struct*);
8struct task_struct* ce_peek_and_take_ready(domain_t*);
9int ce_higher_prio(struct task_struct*, struct task_struct*);
10
11typedef enum hrtimer_restart (*ce_timer_callback_t)(struct hrtimer*);
12
13void ce_domain_init(domain_t*,
14 raw_spinlock_t*,
15 requeue_t,
16 peek_ready_t,
17 take_ready_t,
18 preempt_needed_t,
19 task_prio_t,
20 struct ce_dom_data*,
21 const int,
22 ce_timer_callback_t);
23#endif
diff --git a/include/litmus/sched_mc.h b/include/litmus/sched_mc.h
index ad5d097b3d61..384e65e4151d 100644
--- a/include/litmus/sched_mc.h
+++ b/include/litmus/sched_mc.h
@@ -21,7 +21,10 @@ struct mc_job {
21}; 21};
22 22
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24/* only used in the kernel (no user space) */ 24/*
25 * These are used only in the kernel. Userspace programs like RTSpin won't see
26 * them.
27 */
25 28
26struct mc_data { 29struct mc_data {
27 struct mc_task mc_task; 30 struct mc_task mc_task;
@@ -33,18 +36,8 @@ struct mc_data {
33#define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost) 36#define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost)
34 37
35/* 38/*
36 * Cache the budget along with the struct PID for a task so that we don't need 39 * The MC-CE scheduler uses this as domain data.
37 * to fetch its task_struct every time we check to see what should be
38 * scheduled.
39 */ 40 */
40struct ce_dom_pid_entry {
41 struct pid *pid;
42 lt_t budget;
43 /* accumulated (summed) budgets, including this one */
44 lt_t acc_time;
45 int expected_job;
46};
47
48struct ce_dom_data { 41struct ce_dom_data {
49 int cpu; 42 int cpu;
50 struct task_struct *scheduled, *should_schedule; 43 struct task_struct *scheduled, *should_schedule;
@@ -52,9 +45,6 @@ struct ce_dom_data {
52 * Each CPU needs a mapping of level A ID (integer) to struct pid so 45 * Each CPU needs a mapping of level A ID (integer) to struct pid so
53 * that we can get its task struct. 46 * that we can get its task struct.
54 */ 47 */
55 struct ce_dom_pid_entry pid_entries[CONFIG_PLUGIN_MC_LEVEL_A_MAX_TASKS];
56 int num_pid_entries;
57 lt_t cycle_time;
58 struct hrtimer_start_on_info timer_info; 48 struct hrtimer_start_on_info timer_info;
59 struct hrtimer timer; 49 struct hrtimer timer;
60}; 50};
@@ -90,6 +80,23 @@ typedef struct {
90 crit_entry_t* crit_entry; 80 crit_entry_t* crit_entry;
91} domain_data_t; 81} domain_data_t;
92 82
83/*
84 * Functions that are used with the MC-CE plugin.
85 */
86long mc_ce_set_domains(const int, domain_data_t*[]);
87unsigned int mc_ce_get_expected_job(const int, const int);
88
89/*
90 * These functions are (lazily) inserted into the MC plugin code so that it
91 * manipulates the MC-CE state.
92 */
93long mc_ce_admit_task_common(struct task_struct*);
94void mc_ce_task_exit_common(struct task_struct*);
95void mc_ce_timer_callback_common(domain_t*, struct hrtimer*);
96void mc_ce_release_at_common(struct task_struct*, lt_t);
97long mc_ce_activate_plugin_common(void);
98long mc_ce_deactivate_plugin_common(void);
99
93#endif /* __KERNEL__ */ 100#endif /* __KERNEL__ */
94 101
95#endif 102#endif