allowed_cpus issue in rt_task_init_schmod call
Emmanuel Pacaud <[email protected]>
| Newsgroups | gmane.linux.real-time.rtai |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm facing an issue with rt_task_init_schmod trying to assign a task to a set of cpus. I have attached a sample program that shows this issue. The machine I'm using has 4 cores, and has rtai 5.0-test1. I want to start several instances of a program on the first two cores, leaving the last 2 ones for interrupt handling (they are isolated using isolcpus 2,3). If I use 1 as allowed_cpus mask, all the instances are started on core 0. If I use 2, all the instances are started on core 1. If I use 3, instances run on either core 0, 1, 2 or 3, while I expect them to be running only on core 0 and 1. Is there something wrong in my sample code ? Thanks, Emmanuel. _______________________________________________ Rtai mailing list [email protected] https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
RtaiTaskInitTest.c
(text/x-csrc, 500 B)
#include <rtai.h>
#include <rtai_sched.h>
#include <rtai_tasklets.h>
#include <stdlib.h>
int
main (int argc, char **argv)
{
RT_TASK *task;
rt_allow_nonroot_hrt();
task = rt_task_init_schmod (rt_get_name (0), 10, 0, 0, SCHED_FIFO, 3);
if (task == NULL) {
fprintf (stderr, "rt_task_init_schmod failed\n");
return EXIT_FAILURE;
}
mlockall (MCL_CURRENT | MCL_FUTURE);
rt_make_soft_real_time ();
sleep (120);
rt_make_soft_real_time ();
rt_task_delete (task);
return EXIT_SUCCESS;
}