diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-04-06 10:52:09 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-04-06 10:52:09 -0400 |
commit | 2a604f8edec24b291ba2c5491108808176c9020f (patch) | |
tree | a2954d7cbbb6127cd5168a039bf3d7de9776a719 /include | |
parent | 7b335ec69a6905c80ff3180a6e4dfac937e7d7f5 (diff) |
Better memory management, removed unnecessary preemptions, moved data out of
rt_params and into plugin data, better list managment logic.
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/rt_param.h | 5 | ||||
-rw-r--r-- | include/litmus/servers.h | 28 |
2 files changed, 20 insertions, 13 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 7a28e2b0e3e5..26da5f578a6c 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -190,11 +190,6 @@ struct rt_param { | |||
190 | */ | 190 | */ |
191 | struct list_head list; | 191 | struct list_head list; |
192 | 192 | ||
193 | /* Used for slack stealing */ | ||
194 | struct list_head slack_list; | ||
195 | struct server *slack_server; | ||
196 | int slack_candidate; | ||
197 | |||
198 | /* Pointer to the page shared between userspace and kernel. */ | 193 | /* Pointer to the page shared between userspace and kernel. */ |
199 | struct control_page * ctrl_page; | 194 | struct control_page * ctrl_page; |
200 | 195 | ||
diff --git a/include/litmus/servers.h b/include/litmus/servers.h index 3de9df6e804a..97fd0ce76207 100644 --- a/include/litmus/servers.h +++ b/include/litmus/servers.h | |||
@@ -97,6 +97,8 @@ typedef struct server_domain { | |||
97 | server_completed_t server_completed; | 97 | server_completed_t server_completed; |
98 | servers_released_t servers_released; | 98 | servers_released_t servers_released; |
99 | 99 | ||
100 | struct kmem_cache *server_release_cache; | ||
101 | |||
100 | raw_spinlock_t tobe_lock; | 102 | raw_spinlock_t tobe_lock; |
101 | struct list_head tobe_released; | 103 | struct list_head tobe_released; |
102 | } server_domain_t; | 104 | } server_domain_t; |
@@ -116,31 +118,41 @@ typedef struct server_release_heap { | |||
116 | server_domain_t *domain; | 118 | server_domain_t *domain; |
117 | } server_release_heap_t; | 119 | } server_release_heap_t; |
118 | 120 | ||
121 | /* | ||
122 | * Initialize and exit servers | ||
123 | */ | ||
119 | void server_init(server_t *server, int id, | 124 | void server_init(server_t *server, int id, |
120 | lt_t wcet, lt_t period, int grouped); | 125 | lt_t wcet, lt_t period, int grouped); |
121 | void server_destroy(server_t *server); | 126 | void server_destroy(server_t *server); |
122 | 127 | ||
128 | /* | ||
129 | * Memory manage servers on the module slabs. | ||
130 | */ | ||
131 | server_t* server_alloc(int gfp_flags); | ||
132 | void server_free(server_t *server); | ||
133 | |||
134 | /* | ||
135 | * Initialize and exit the server domain. | ||
136 | */ | ||
123 | void server_domain_init(server_domain_t *domain, | 137 | void server_domain_init(server_domain_t *domain, |
124 | servers_released_t servers_released, | 138 | servers_released_t servers_released, |
125 | server_completed_t server_completed, | 139 | server_completed_t server_completed, |
126 | int release_master, raw_spinlock_t* timer_lock); | 140 | int release_master, raw_spinlock_t* timer_lock); |
127 | void server_domain_exit(server_domain_t *domain); | 141 | void server_domain_destroy(server_domain_t *domain); |
128 | 142 | ||
143 | /* | ||
144 | * Adds the next release of the server to the domain's timer. | ||
145 | */ | ||
129 | int add_server_release(server_t *server, server_domain_t *server_domain); | 146 | int add_server_release(server_t *server, server_domain_t *server_domain); |
130 | 147 | ||
131 | /* | 148 | /* |
132 | * Runs a task on the server. If the server runs out of budget | 149 | * Runs a task on the server. |
133 | * before the task finishes executing, the server will set its | ||
134 | * budget to 0 and call post_completion. If task is NULL, the server | ||
135 | * will just run on the current CPU. | ||
136 | */ | 150 | */ |
137 | void server_run(server_t *server, struct task_struct *task, | 151 | void server_run(server_t *server, struct task_struct *task, |
138 | server_domain_t *server_domain); | 152 | server_domain_t *server_domain); |
139 | 153 | ||
140 | /* | 154 | /* |
141 | * Stops server execution. This will decrement the budget | 155 | * Stops server execution. |
142 | * by the amount of time since server_run_task was called, based | ||
143 | * on the task execution time or current time, if task was NULL. | ||
144 | */ | 156 | */ |
145 | void server_stop(server_t *server, server_domain_t *domain); | 157 | void server_stop(server_t *server, server_domain_t *domain); |
146 | 158 | ||