diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2015-02-18 09:55:13 +0100 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2015-03-03 13:58:57 +0100 |
commit | 1207d5bdc0258716c753f17ef6171f5c9d8c96b6 (patch) | |
tree | 3471cd5fd8a650487d7e5ed907c18233bafca303 | |
parent | 4f09abf780888677727e9d0cb63f9c96ae2ad369 (diff) | |
download | rt-tests-1207d5bdc0258716c753f17ef6171f5c9d8c96b6.tar.gz |
pi_stress: Clear affinity for DEADLINE tasks
Deadline tasks are not allowed to set smp affinity.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r-- | src/pi_tests/pi_stress.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index cf55712..aaa36c3 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -882,8 +882,21 @@ void *high_priority(void *arg) pthread_barrier_t *loop_barr = &p->loop_barr; pthread_mutex_t *loop_mtx = &p->loop_mtx; int *loop = &p->loop; + cpu_set_t cpu_mask; + int i; if (high_sa.sched_policy == SCHED_DEADLINE) { + CPU_ZERO(&cpu_mask); + for (i = 0; i < num_processors; i++) + CPU_SET(i, &cpu_mask); + status = sched_setaffinity(0, sizeof(cpu_set_t), &cpu_mask); + if (status < 0) { + pi_error + ("high_priority[%d]: set cpu affinity*dl): %x\n", + p->id, status); + return NULL; + } + status = sched_setattr(gettid(), &high_sa, 0); if (status < 0) { pi_error |