diff options
Diffstat (limited to 'include/litmus/rt_param.h')
-rw-r--r-- | include/litmus/rt_param.h | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 4293575d3472..2ced0dba067d 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -30,7 +30,7 @@ typedef enum { | |||
30 | typedef enum { | 30 | typedef enum { |
31 | NO_ENFORCEMENT, /* job may overrun unhindered */ | 31 | NO_ENFORCEMENT, /* job may overrun unhindered */ |
32 | QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ | 32 | QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ |
33 | PRECISE_ENFORCEMENT /* NOT IMPLEMENTED - enforced with hrtimers */ | 33 | PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ |
34 | } budget_policy_t; | 34 | } budget_policy_t; |
35 | 35 | ||
36 | struct rt_task { | 36 | struct rt_task { |
@@ -42,6 +42,16 @@ struct rt_task { | |||
42 | budget_policy_t budget_policy; /* ignored by pfair */ | 42 | budget_policy_t budget_policy; /* ignored by pfair */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | union np_flag { | ||
46 | uint32_t raw; | ||
47 | struct { | ||
48 | /* Is the task currently in a non-preemptive section? */ | ||
49 | uint32_t flag:31; | ||
50 | /* Should the task call into the scheduler? */ | ||
51 | uint32_t preempt:1; | ||
52 | } np; | ||
53 | }; | ||
54 | |||
45 | /* The definition of the data that is shared between the kernel and real-time | 55 | /* The definition of the data that is shared between the kernel and real-time |
46 | * tasks via a shared page (see litmus/ctrldev.c). | 56 | * tasks via a shared page (see litmus/ctrldev.c). |
47 | * | 57 | * |
@@ -57,16 +67,33 @@ struct rt_task { | |||
57 | * determining preemption/migration overheads). | 67 | * determining preemption/migration overheads). |
58 | */ | 68 | */ |
59 | struct control_page { | 69 | struct control_page { |
60 | /* Is the task currently in a non-preemptive section? */ | 70 | volatile union np_flag sched; |
61 | int np_flag; | ||
62 | /* Should the task call into the kernel when it leaves | ||
63 | * its non-preemptive section? */ | ||
64 | int delayed_preemption; | ||
65 | 71 | ||
66 | /* locking overhead tracing: time stamp prior to system call */ | 72 | /* locking overhead tracing: time stamp prior to system call */ |
67 | uint64_t ts_syscall_start; /* Feather-Trace cycles */ | 73 | uint64_t ts_syscall_start; /* Feather-Trace cycles */ |
68 | 74 | ||
69 | /* to be extended */ | 75 | int colors_updated:8; |
76 | }; | ||
77 | |||
78 | #ifndef __KERNEL__ | ||
79 | /* | ||
80 | * XXX This is a terrible hack so liblitmus can use the PAGE_SIZE macro. | ||
81 | * We should fix liblitmus to do setup the page size at runtime. | ||
82 | */ | ||
83 | #define CACHE_LINE_SIZE 64 | ||
84 | #if (ARCH == x86_64) | ||
85 | #define PAGE_SIZE 4096 | ||
86 | #elif (ARCH == sparc64) | ||
87 | #define PAGE_SIZE 8192 | ||
88 | #endif | ||
89 | #endif /* ifndef __KERNEL__ */ | ||
90 | |||
91 | typedef uint8_t color_t; | ||
92 | #define COLORS_PER_CONTROL_PAGE (PAGE_SIZE / (2 * sizeof(color_t))) | ||
93 | struct color_ctrl_page { | ||
94 | color_t colors[COLORS_PER_CONTROL_PAGE]; | ||
95 | /* must be same type to guarantee equal array sizes */ | ||
96 | color_t pages[COLORS_PER_CONTROL_PAGE]; | ||
70 | }; | 97 | }; |
71 | 98 | ||
72 | /* don't export internal data structures to user space (liblitmus) */ | 99 | /* don't export internal data structures to user space (liblitmus) */ |
@@ -76,6 +103,8 @@ struct _rt_domain; | |||
76 | struct bheap_node; | 103 | struct bheap_node; |
77 | struct release_heap; | 104 | struct release_heap; |
78 | struct domain; | 105 | struct domain; |
106 | struct rt_server; | ||
107 | struct dgl_group_req; | ||
79 | 108 | ||
80 | struct rt_job { | 109 | struct rt_job { |
81 | /* Time instant the the job was or will be released. */ | 110 | /* Time instant the the job was or will be released. */ |
@@ -119,6 +148,8 @@ struct rt_param { | |||
119 | /* is the task present? (true if it can be scheduled) */ | 148 | /* is the task present? (true if it can be scheduled) */ |
120 | unsigned int present:1; | 149 | unsigned int present:1; |
121 | 150 | ||
151 | unsigned int is_server:1; | ||
152 | |||
122 | #ifdef CONFIG_LITMUS_LOCKING | 153 | #ifdef CONFIG_LITMUS_LOCKING |
123 | /* Is the task being priority-boosted by a locking protocol? */ | 154 | /* Is the task being priority-boosted by a locking protocol? */ |
124 | unsigned int priority_boosted:1; | 155 | unsigned int priority_boosted:1; |
@@ -134,6 +165,9 @@ struct rt_param { | |||
134 | struct rt_event *event; | 165 | struct rt_event *event; |
135 | #endif | 166 | #endif |
136 | 167 | ||
168 | struct rt_server *server; | ||
169 | |||
170 | |||
137 | /* user controlled parameters */ | 171 | /* user controlled parameters */ |
138 | struct rt_task task_params; | 172 | struct rt_task task_params; |
139 | 173 | ||
@@ -213,6 +247,16 @@ struct rt_param { | |||
213 | 247 | ||
214 | /* Pointer to the page shared between userspace and kernel. */ | 248 | /* Pointer to the page shared between userspace and kernel. */ |
215 | struct control_page * ctrl_page; | 249 | struct control_page * ctrl_page; |
250 | |||
251 | lt_t total_tardy; | ||
252 | lt_t max_tardy; | ||
253 | unsigned int missed; | ||
254 | |||
255 | lt_t max_exec_time; | ||
256 | lt_t tot_exec_time; | ||
257 | lt_t last_exec_time; | ||
258 | struct color_ctrl_page *color_ctrl_page; | ||
259 | struct dgl_group_req *req; | ||
216 | }; | 260 | }; |
217 | 261 | ||
218 | /* Possible RT flags */ | 262 | /* Possible RT flags */ |