diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-05 18:32:01 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-12 12:47:20 -0400 |
commit | 0a54a84457bb8a33113c7dd2a2b63b2a837cc92e (patch) | |
tree | 78bd56eec72c7d47749155315d3506c424e0dc24 /include | |
parent | 93ffe5be8fd1954bbfe5a04e55b81ac1d83d2de7 (diff) |
Cluster-aware rtspin and rt_launch.
This patch adds cluster scheduling options to
rtspin and rt_launch. The convenience routines
in litmus.h were also updated to facilitate
clustered scheduling. For partitioned scheduling,
just set cluster_size = 1 (default size for rtspin
and rt_launch).
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus.h | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/include/litmus.h b/include/litmus.h index b2e81f2..335d01b 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -21,6 +21,13 @@ extern "C" { | |||
21 | int set_rt_task_param(pid_t pid, struct rt_task* param); | 21 | int set_rt_task_param(pid_t pid, struct rt_task* param); |
22 | int get_rt_task_param(pid_t pid, struct rt_task* param); | 22 | int get_rt_task_param(pid_t pid, struct rt_task* param); |
23 | 23 | ||
24 | /* Release-master-aware functions for getting the first | ||
25 | * CPU in a particular cluster or partition. Use these | ||
26 | * to set rt_task::cpu for cluster/partitioned scheduling. | ||
27 | */ | ||
28 | int partition_to_cpu(int partition); | ||
29 | int cluster_to_first_cpu(int cluster, int cluster_size); | ||
30 | |||
24 | /* setup helper */ | 31 | /* setup helper */ |
25 | 32 | ||
26 | /* Times are given in ms. The 'priority' parameter | 33 | /* Times are given in ms. The 'priority' parameter |
@@ -30,9 +37,9 @@ int get_rt_task_param(pid_t pid, struct rt_task* param); | |||
30 | */ | 37 | */ |
31 | int sporadic_task( | 38 | int sporadic_task( |
32 | lt_t e, lt_t p, lt_t phase, | 39 | lt_t e, lt_t p, lt_t phase, |
33 | int partition, unsigned int priority, | 40 | int cluster, int cluster_size, unsigned int priority, |
34 | task_class_t cls, | 41 | task_class_t cls, |
35 | budget_policy_t budget_policy, int set_cpu_set); | 42 | budget_policy_t budget_policy, int be_migrate); |
36 | 43 | ||
37 | /* Times are given in ns. The 'priority' parameter | 44 | /* Times are given in ns. The 'priority' parameter |
38 | * is only relevant under fixed-priority scheduling (and | 45 | * is only relevant under fixed-priority scheduling (and |
@@ -41,16 +48,19 @@ int sporadic_task( | |||
41 | */ | 48 | */ |
42 | int sporadic_task_ns( | 49 | int sporadic_task_ns( |
43 | lt_t e, lt_t p, lt_t phase, | 50 | lt_t e, lt_t p, lt_t phase, |
44 | int cpu, unsigned int priority, | 51 | int cluster, int cluster_size, unsigned int priority, |
45 | task_class_t cls, | 52 | task_class_t cls, |
46 | budget_policy_t budget_policy, int set_cpu_set); | 53 | budget_policy_t budget_policy, int be_migrate); |
47 | 54 | ||
48 | /* Convenience macros. Budget enforcement off by default in these macros. */ | 55 | /* Convenience macros. Budget enforcement off by default in these macros. */ |
49 | #define sporadic_global(e, p) \ | 56 | #define sporadic_global(e, p) \ |
50 | sporadic_task(e, p, 0, 0, LITMUS_LOWEST_PRIORITY, \ | 57 | sporadic_task(e, p, 0, 0, 0, LITMUS_LOWEST_PRIORITY, \ |
51 | RT_CLASS_SOFT, NO_ENFORCEMENT, 0) | 58 | RT_CLASS_SOFT, NO_ENFORCEMENT, 0) |
52 | #define sporadic_partitioned(e, p, cpu) \ | 59 | #define sporadic_partitioned(e, p, partition) \ |
53 | sporadic_task(e, p, 0, cpu, LITMUS_LOWEST_PRIORITY, \ | 60 | sporadic_task(e, p, 0, partition, 1, LITMUS_LOWEST_PRIORITY, \ |
61 | RT_CLASS_SOFT, NO_ENFORCEMENT, 1) | ||
62 | #define sporadic_clustered(e, p, cluster, cluster_size) \ | ||
63 | sporadic_task(e, p, 0, cluster, cluster_size, LITMUS_LOWEST_PRIORITY, \ | ||
54 | RT_CLASS_SOFT, NO_ENFORCEMENT, 1) | 64 | RT_CLASS_SOFT, NO_ENFORCEMENT, 1) |
55 | 65 | ||
56 | /* file descriptor attached shared objects support */ | 66 | /* file descriptor attached shared objects support */ |
@@ -98,10 +108,14 @@ void exit_litmus(void); | |||
98 | /* A real-time program. */ | 108 | /* A real-time program. */ |
99 | typedef int (*rt_fn_t)(void*); | 109 | typedef int (*rt_fn_t)(void*); |
100 | 110 | ||
101 | /* These two functions configure the RT task to use enforced exe budgets */ | 111 | /* These two functions configure the RT task to use enforced exe budgets. |
102 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, lt_t wcet, lt_t period, unsigned int prio); | 112 | * Partitioned scheduling: cluster = desired partition, cluster_size = 1 |
103 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, lt_t wcet, | 113 | * Global scheduling: cluster = 0, cluster_size = 0 |
104 | lt_t period, unsigned int priority, task_class_t cls); | 114 | */ |
115 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | ||
116 | lt_t wcet, lt_t period, unsigned int prio); | ||
117 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | ||
118 | lt_t wcet, lt_t period, unsigned int prio, task_class_t cls); | ||
105 | 119 | ||
106 | /* per-task modes */ | 120 | /* per-task modes */ |
107 | enum rt_task_mode_t { | 121 | enum rt_task_mode_t { |