diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-09 13:19:55 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-09 13:19:55 -0400 |
| commit | ed4dcc5939e497199404647d7d9d8569432485dc (patch) | |
| tree | 00fb3643864aa06e9e85f3bc062f6ccd5b648c27 /include | |
| parent | 115e784516a9d0994b4a9d5730a4b1a4be6fcc58 (diff) | |
rt_domain: do not allocate/free memory in release queue handling
This fixes a bunch of bugs:
- a memory leak (some heap nodes were never reclaimed)
- a locking rules violation (memory allocation can wake up kswapd,
which causes a circular locking dependency between the release queue lock
and the run queue locks
Also, allocating memory in a hot path was never particularly clever.
This patch pre-allocates memory at task-creation time, but does not change
how the release queue works overall.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/rt_domain.h | 4 | ||||
| -rw-r--r-- | include/litmus/rt_param.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index 7356ec7ca4..9323892a87 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
| @@ -21,6 +21,10 @@ struct release_heap { | |||
| 21 | struct list_head list; | 21 | struct list_head list; |
| 22 | lt_t release_time; | 22 | lt_t release_time; |
| 23 | struct heap heap; | 23 | struct heap heap; |
| 24 | /* the node used to enqueue this heap in a | ||
| 25 | * release queue | ||
| 26 | */ | ||
| 27 | struct heap_node* hn; | ||
| 24 | }; | 28 | }; |
| 25 | 29 | ||
| 26 | struct release_queue { | 30 | struct release_queue { |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 155543ea93..a0d5de2aa5 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
| @@ -40,6 +40,7 @@ struct rt_task { | |||
| 40 | 40 | ||
| 41 | struct _rt_domain; | 41 | struct _rt_domain; |
| 42 | struct heap_node; | 42 | struct heap_node; |
| 43 | struct release_heap; | ||
| 43 | 44 | ||
| 44 | struct rt_job { | 45 | struct rt_job { |
| 45 | /* Time instant the the job was or will be released. */ | 46 | /* Time instant the the job was or will be released. */ |
| @@ -160,6 +161,7 @@ struct rt_param { | |||
| 160 | * implementation). | 161 | * implementation). |
| 161 | */ | 162 | */ |
| 162 | struct heap_node* heap_node; | 163 | struct heap_node* heap_node; |
| 164 | struct release_heap* rel_heap; | ||
| 163 | 165 | ||
| 164 | /* Used by rt_domain to queue task in release list. | 166 | /* Used by rt_domain to queue task in release list. |
| 165 | */ | 167 | */ |
