aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-01-11 14:37:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-01-11 14:37:13 -0500
commit5d7dcfa10ea0dd283773a301e3ce610a7797d582 (patch)
tree7f7a57ac940e7fe1f538cdd771a954d4fb28f8c0 /include/litmus
parent3d5537c160c1484e8d562b9828baf679cc53f67a (diff)
PAI implementation, C-RM, C-FIFO.
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/fifo_common.h25
-rw-r--r--include/litmus/litmus.h4
-rw-r--r--include/litmus/nvidia_info.h3
-rw-r--r--include/litmus/rm_common.h25
-rw-r--r--include/litmus/rm_srt_common.h25
-rw-r--r--include/litmus/sched_plugin.h11
-rw-r--r--include/litmus/sched_trace.h8
-rw-r--r--include/litmus/sched_trace_external.h22
-rw-r--r--include/litmus/trace.h14
9 files changed, 128 insertions, 9 deletions
diff --git a/include/litmus/fifo_common.h b/include/litmus/fifo_common.h
new file mode 100644
index 000000000000..12cfbfea41ee
--- /dev/null
+++ b/include/litmus/fifo_common.h
@@ -0,0 +1,25 @@
1/*
2 * EDF common data structures and utility functions shared by all EDF
3 * based scheduler plugins
4 */
5
6/* CLEANUP: Add comments and make it less messy.
7 *
8 */
9
10#ifndef __UNC_FIFO_COMMON_H__
11#define __UNC_FIFO_COMMON_H__
12
13#include <litmus/rt_domain.h>
14
15void fifo_domain_init(rt_domain_t* rt, check_resched_needed_t resched,
16 release_jobs_t release);
17
18int fifo_higher_prio(struct task_struct* first,
19 struct task_struct* second);
20
21int fifo_ready_order(struct bheap_node* a, struct bheap_node* b);
22
23int fifo_preemption_needed(rt_domain_t* rt, struct task_struct *t);
24
25#endif
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 3df242bf272f..829c1c5ab91f 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -118,7 +118,9 @@ static inline lt_t litmus_clock(void)
118#define earlier_release(a, b) (lt_before(\ 118#define earlier_release(a, b) (lt_before(\
119 (a)->rt_param.job_params.release,\ 119 (a)->rt_param.job_params.release,\
120 (b)->rt_param.job_params.release)) 120 (b)->rt_param.job_params.release))
121 121#define shorter_period(a, b) (lt_before(\
122 (a)->rt_param.task_params.period,\
123 (b)->rt_param.task_params.period))
122void preempt_if_preemptable(struct task_struct* t, int on_cpu); 124void preempt_if_preemptable(struct task_struct* t, int on_cpu);
123 125
124#ifdef CONFIG_LITMUS_LOCKING 126#ifdef CONFIG_LITMUS_LOCKING
diff --git a/include/litmus/nvidia_info.h b/include/litmus/nvidia_info.h
index 579301d77cf5..9e07a27fdee3 100644
--- a/include/litmus/nvidia_info.h
+++ b/include/litmus/nvidia_info.h
@@ -7,7 +7,8 @@
7#include <litmus/litmus_softirq.h> 7#include <litmus/litmus_softirq.h>
8 8
9 9
10#define NV_DEVICE_NUM NR_LITMUS_SOFTIRQD 10//#define NV_DEVICE_NUM NR_LITMUS_SOFTIRQD
11#define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM
11 12
12int init_nvidia_info(void); 13int init_nvidia_info(void);
13 14
diff --git a/include/litmus/rm_common.h b/include/litmus/rm_common.h
new file mode 100644
index 000000000000..5991b0b4e758
--- /dev/null
+++ b/include/litmus/rm_common.h
@@ -0,0 +1,25 @@
1/*
2 * EDF common data structures and utility functions shared by all EDF
3 * based scheduler plugins
4 */
5
6/* CLEANUP: Add comments and make it less messy.
7 *
8 */
9
10#ifndef __UNC_RM_COMMON_H__
11#define __UNC_RM_COMMON_H__
12
13#include <litmus/rt_domain.h>
14
15void rm_domain_init(rt_domain_t* rt, check_resched_needed_t resched,
16 release_jobs_t release);
17
18int rm_higher_prio(struct task_struct* first,
19 struct task_struct* second);
20
21int rm_ready_order(struct bheap_node* a, struct bheap_node* b);
22
23int rm_preemption_needed(rt_domain_t* rt, struct task_struct *t);
24
25#endif
diff --git a/include/litmus/rm_srt_common.h b/include/litmus/rm_srt_common.h
new file mode 100644
index 000000000000..78aa287327a2
--- /dev/null
+++ b/include/litmus/rm_srt_common.h
@@ -0,0 +1,25 @@
1/*
2 * EDF common data structures and utility functions shared by all EDF
3 * based scheduler plugins
4 */
5
6/* CLEANUP: Add comments and make it less messy.
7 *
8 */
9
10#ifndef __UNC_RM_SRT_COMMON_H__
11#define __UNC_RM_SRT_COMMON_H__
12
13#include <litmus/rt_domain.h>
14
15void rm_srt_domain_init(rt_domain_t* rt, check_resched_needed_t resched,
16 release_jobs_t release);
17
18int rm_srt_higher_prio(struct task_struct* first,
19 struct task_struct* second);
20
21int rm_srt_ready_order(struct bheap_node* a, struct bheap_node* b);
22
23int rm_srt_preemption_needed(rt_domain_t* rt, struct task_struct *t);
24
25#endif
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index df50930d14a0..12a9ab65a673 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -11,6 +11,10 @@
11#include <litmus/locking.h> 11#include <litmus/locking.h>
12#endif 12#endif
13 13
14#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
15#include <linux/interrupt.h>
16#endif
17
14/************************ setup/tear down ********************/ 18/************************ setup/tear down ********************/
15 19
16typedef long (*activate_plugin_t) (void); 20typedef long (*activate_plugin_t) (void);
@@ -69,6 +73,9 @@ typedef void (*set_prio_inh_klitirq_t)(struct task_struct* klitirqd,
69typedef void (*clear_prio_inh_klitirqd_t)(struct task_struct* klitirqd, 73typedef void (*clear_prio_inh_klitirqd_t)(struct task_struct* klitirqd,
70 struct task_struct* old_owner); 74 struct task_struct* old_owner);
71 75
76
77typedef int (*enqueue_pai_tasklet_t)(struct tasklet_struct* tasklet);
78
72/********************* sys call backends ********************/ 79/********************* sys call backends ********************/
73/* This function causes the caller to sleep until the next release */ 80/* This function causes the caller to sleep until the next release */
74typedef long (*complete_job_t) (void); 81typedef long (*complete_job_t) (void);
@@ -115,6 +122,10 @@ struct sched_plugin {
115 set_prio_inh_klitirq_t set_prio_inh_klitirqd; 122 set_prio_inh_klitirq_t set_prio_inh_klitirqd;
116 clear_prio_inh_klitirqd_t clear_prio_inh_klitirqd; 123 clear_prio_inh_klitirqd_t clear_prio_inh_klitirqd;
117#endif 124#endif
125
126#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
127 enqueue_pai_tasklet_t enqueue_pai_tasklet;
128#endif
118} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); 129} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
119 130
120 131
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h
index 1486c778aff8..232c7588d103 100644
--- a/include/litmus/sched_trace.h
+++ b/include/litmus/sched_trace.h
@@ -127,13 +127,13 @@ struct st_effective_priority_change_data {
127struct st_nv_interrupt_begin_data { 127struct st_nv_interrupt_begin_data {
128 u64 when; 128 u64 when;
129 u32 device; 129 u32 device;
130 u8 __unused[4]; 130 u32 serialNumber;
131} __attribute__((packed)); 131} __attribute__((packed));
132 132
133struct st_nv_interrupt_end_data { 133struct st_nv_interrupt_end_data {
134 u64 when; 134 u64 when;
135 u32 device; 135 u32 device;
136 u8 __unused[4]; 136 u32 serialNumber;
137} __attribute__((packed)); 137} __attribute__((packed));
138 138
139#define DATA(x) struct st_ ## x ## _data x; 139#define DATA(x) struct st_ ## x ## _data x;
@@ -328,8 +328,8 @@ feather_callback void do_sched_trace_nv_interrupt_end(unsigned long id,
328 328
329#define sched_trace_nv_interrupt_begin(d) \ 329#define sched_trace_nv_interrupt_begin(d) \
330 SCHED_TRACE(SCHED_TRACE_BASE_ID + 18, do_sched_trace_nv_interrupt_begin, d) 330 SCHED_TRACE(SCHED_TRACE_BASE_ID + 18, do_sched_trace_nv_interrupt_begin, d)
331#define sched_trace_nv_interrupt_end() \ 331#define sched_trace_nv_interrupt_end(d) \
332 SCHED_TRACE(SCHED_TRACE_BASE_ID + 19, do_sched_trace_nv_interrupt_end, 0ul) 332 SCHED_TRACE(SCHED_TRACE_BASE_ID + 19, do_sched_trace_nv_interrupt_end, d)
333 333
334#define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ 334#define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */
335 335
diff --git a/include/litmus/sched_trace_external.h b/include/litmus/sched_trace_external.h
index c2c872639880..90424d5c564c 100644
--- a/include/litmus/sched_trace_external.h
+++ b/include/litmus/sched_trace_external.h
@@ -34,9 +34,25 @@ static inline void sched_trace_nv_interrupt_begin_external(u32 device)
34 __sched_trace_nv_interrupt_begin_external(device); 34 __sched_trace_nv_interrupt_begin_external(device);
35} 35}
36 36
37extern void __sched_trace_nv_interrupt_end_external(void); 37extern void __sched_trace_nv_interrupt_end_external(u32 device);
38static inline void sched_trace_nv_interrupt_end_external(void) 38static inline void sched_trace_nv_interrupt_end_external(u32 device)
39{ 39{
40 __sched_trace_nv_interrupt_end_external(); 40 __sched_trace_nv_interrupt_end_external(device);
41} 41}
42
43#ifdef CONFIG_LITMUS_NVIDIA
44
45#define EX_TS(evt) \
46extern void __##evt(void); \
47static inline void EX_##evt(void) { __##evt(); }
48
49EX_TS(TS_NV_TOPISR_START)
50EX_TS(TS_NV_TOPISR_END)
51EX_TS(TS_NV_BOTISR_START)
52EX_TS(TS_NV_BOTISR_END)
53EX_TS(TS_NV_RELEASE_BOTISR_START)
54EX_TS(TS_NV_RELEASE_BOTISR_END)
55
56#endif
57
42#endif 58#endif
diff --git a/include/litmus/trace.h b/include/litmus/trace.h
index 05f487263f28..aa3ee4a6757b 100644
--- a/include/litmus/trace.h
+++ b/include/litmus/trace.h
@@ -100,4 +100,18 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu)
100#define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) 100#define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN)
101 101
102 102
103
104#ifdef CONFIG_LITMUS_NVIDIA
105
106#define TS_NV_TOPISR_START TIMESTAMP(200)
107#define TS_NV_TOPISR_END TIMESTAMP(201)
108
109#define TS_NV_BOTISR_START TIMESTAMP(202)
110#define TS_NV_BOTISR_END TIMESTAMP(203)
111
112#define TS_NV_RELEASE_BOTISR_START TIMESTAMP(204)
113#define TS_NV_RELEASE_BOTISR_END TIMESTAMP(205)
114
115#endif
116
103#endif /* !_SYS_TRACE_H_ */ 117#endif /* !_SYS_TRACE_H_ */