aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-03-12 11:57:42 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2013-03-12 12:02:20 -0400
commit93ffe5be8fd1954bbfe5a04e55b81ac1d83d2de7 (patch)
treed77875e14dd822680ed168816286d994d2d3d93e /include
parent1ff4fc699f01f0ad1359fad48b00c9d3be1b28b4 (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.h8
-rw-r--r--include/migration.h24
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
19typedef int pid_t; /* PID of a task */ 19#include "migration.h"
20
21/* obtain the PID of a thread */
22pid_t gettid(void);
23
24/* migrate to partition */
25int be_migrate_to(int target_cpu);
26 20
27int set_rt_task_param(pid_t pid, struct rt_task* param); 21int set_rt_task_param(pid_t pid, struct rt_task* param);
28int get_rt_task_param(pid_t pid, struct rt_task* param); 22int 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
2typedef int pid_t;
3
4/* obtain the PID of a thread */
5pid_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 */
10int be_migrate_thread_to_cpu(pid_t tid, int target_cpu);
11int 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. */
14int 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 */
17int __be_migrate_thread_to_cluster(pid_t tid, int cluster, int cluster_sz, int ignore_rm);
18
19int be_migrate_to_cpu(int target_cpu);
20int be_migrate_to_partition(int partition);
21int be_migrate_to_cluster(int cluster, int cluster_sz);
22
23int num_online_cpus();
24int release_master();