diff options
| author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-12 11:57:42 -0400 |
|---|---|---|
| committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-12 12:02:20 -0400 |
| commit | 93ffe5be8fd1954bbfe5a04e55b81ac1d83d2de7 (patch) | |
| tree | d77875e14dd822680ed168816286d994d2d3d93e /include | |
| parent | 1ff4fc699f01f0ad1359fad48b00c9d3be1b28b4 (diff) | |
Auto-CPU-affinity from part./cluster assignment.
This patch replaces be_migrate_to() with several
be_migrate_*() APIs to automatically assign CPU affinity
masks from a task's partition (or cluster) assignment.
Routines are release-master-aware such that the release
master (if one exists) will NOT be included in the
task's affinity mask. (Note that release-master
avoidance may be overridden by calling
__be_migrate_thread_to_cluster().)
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus.h | 8 | ||||
| -rw-r--r-- | include/migration.h | 24 |
2 files changed, 25 insertions, 7 deletions
diff --git a/include/litmus.h b/include/litmus.h index 58af6b7..b2e81f2 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
| @@ -16,13 +16,7 @@ extern "C" { | |||
| 16 | 16 | ||
| 17 | #include "asm/cycles.h" /* for null_call() */ | 17 | #include "asm/cycles.h" /* for null_call() */ |
| 18 | 18 | ||
| 19 | typedef int pid_t; /* PID of a task */ | 19 | #include "migration.h" |
| 20 | |||
| 21 | /* obtain the PID of a thread */ | ||
| 22 | pid_t gettid(void); | ||
| 23 | |||
| 24 | /* migrate to partition */ | ||
| 25 | int be_migrate_to(int target_cpu); | ||
| 26 | 20 | ||
| 27 | 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); |
| 28 | 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); |
diff --git a/include/migration.h b/include/migration.h new file mode 100644 index 0000000..2413e7c --- /dev/null +++ b/include/migration.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | |||
| 2 | typedef int pid_t; | ||
| 3 | |||
| 4 | /* obtain the PID of a thread */ | ||
| 5 | pid_t gettid(); | ||
| 6 | |||
| 7 | /* Assign a task to a cpu/partition/cluster. | ||
| 8 | * PRECOND: tid is not yet in real-time mode (it's a best effort task). | ||
| 9 | * Set tid == 0 to migrate the caller */ | ||
| 10 | int be_migrate_thread_to_cpu(pid_t tid, int target_cpu); | ||
| 11 | int be_migrate_thread_to_partition(pid_t tid, int partition); | ||
| 12 | /* If using release master, set cluster_sz to size of largest cluster. tid | ||
| 13 | * will not be scheduled on release master. */ | ||
| 14 | int be_migrate_thread_to_cluster(pid_t tid, int cluster, int cluster_sz); | ||
| 15 | |||
| 16 | /* set ignore_rm == 1 to include release master in tid's cpu affinity */ | ||
| 17 | int __be_migrate_thread_to_cluster(pid_t tid, int cluster, int cluster_sz, int ignore_rm); | ||
| 18 | |||
| 19 | int be_migrate_to_cpu(int target_cpu); | ||
| 20 | int be_migrate_to_partition(int partition); | ||
| 21 | int be_migrate_to_cluster(int cluster, int cluster_sz); | ||
| 22 | |||
| 23 | int num_online_cpus(); | ||
| 24 | int release_master(); | ||
