Process load balancing among CPU
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
Regards,
S.Ancelot
I noticed that when I launch processes linked with xenomai, these programs are automatically linked to a single process
using cat /proc/<pid>/status
the cpus_allowed value is linked to a single cpu .
Doing the same on a singular linux process (eg xterm) , the cpus_allowed value is f , permitted to switch along all my cpus .
So, I suppose if I want a process using only xenomai shm must have cpuset affinity defined in order being able to switch to other cpu ????
Le 24/10/2019 à 10:00, Stéphane Ancelot via Xenomai a écrit :
Quoted 13 lines
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
Regards,
S.Ancelot
Quoted 9 lines · Stéphane Ancelot via Xenomai
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
Quoted 5 lines
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
Jan
Le 24/10/2019 à 12:13, Jan Kiszka a écrit :
Quoted 10 lines · Stéphane Ancelot via Xenomai
Quoted 9 lines
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
Quoted 7 lines
Quoted 5 lines
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
This is not an RT thread, this is a userspace non rt task linking xenomai heap shared memory.
having a look at this page, the documentation states cpu_affinity Defaults to any online CPU.
Quoted 1 line
Jan
Quoted 17 lines · Stéphane Ancelot
Le 24/10/2019 à 12:13, Jan Kiszka a écrit :
Quoted 15 lines · Stéphane Ancelot via Xenomai
Quoted 14 lines
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
Quoted 8 lines
Quoted 2 lines
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
This is not an RT thread, this is a userspace non rt task linking xenomai heap shared memory.
having a look at this page, the documentation states
cpu_affinityDefaults to any online CPU.
As long as that non-RT task is in Linux mode and has an affinity mask that is not reduced to the single core, Linux will happily load-balance it. But if that task went through shadowing by Xenomai, its affinity mask was likely reduced.
Jan
Le 24/10/2019 à 12:28, Jan Kiszka a écrit :
Quoted 22 lines · Stéphane Ancelot
Quoted 21 lines
Le 24/10/2019 à 12:13, Jan Kiszka a écrit :
Quoted 10 lines · Stéphane Ancelot via Xenomai
Quoted 9 lines
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
Quoted 7 lines
Quoted 5 lines
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
This is not an RT thread, this is a userspace non rt task linking xenomai heap shared memory.
Quoted 6 lines
Quoted 2 lines
having a look at this page, the documentation states
cpu_affinityDefaults to any online CPU.As long as that non-RT task is in Linux mode and has an affinity mask that is not reduced to the single core, Linux will happily load-balance it. But if that task went through shadowing by Xenomai, its affinity mask was likely reduced.
A tunable should permit to change it, but it has no effect
cpu_set_t cpus;
CPU_ZERO(&cpus);
CPU_SET(0,&cpus);
CPU_SET(1,&cpus);
CPU_SET(2,&cpus);
CPU_SET(3,&cpus);
set_config_tunable(cpu_affinity,cpus);
Quoted 1 line
Jan
Nothing has an effect, as the cobalt setup routine binds the main thread to the single core.
See: https://xenomai.org/pipermail/xenomai/2019-August/041381.html
Every thread you spawn will inherit the same affinity mask (with a single bit set), and all options (tunables, cmdline) affect the mask *before* the setup then picks the current core as mask. You will need to reset the affinity mask yourself.
Kind regards, Norbert
Quoted 43 lines
-----Original Message-----
From: Xenomai <[email protected]> On Behalf Of Stéphane Ancelot via Xenomai
Sent: Donnerstag, 24. Oktober 2019 16:01
To: Jan Kiszka <[email protected]>; [email protected]
Subject: Re: Process load balancing among CPUNON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR ATTACHMENTS.
Quoted 22 lines · Jan Kiszka
Quoted 21 lines · Stéphane Ancelot
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Stéphane Ancelot via Xenomai
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
Quoted 7 lines
Quoted 5 lines
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
This is not an RT thread, this is a userspace non rt task linking xenomai heap shared memory.
Quoted 6 lines
Quoted 2 lines
having a look at this page, the documentation states
cpu_affinityDefaults to any online CPU.As long as that non-RT task is in Linux mode and has an affinity mask that is not reduced to the single core, Linux will happily load-balance it. But if that task went through shadowing by Xenomai, its affinity mask was likely reduced.
A tunable should permit to change it, but it has no effect
Quoted 10 lines
cpu_set_t cpus; CPU_ZERO(&cpus); CPU_SET(0,&cpus); CPU_SET(1,&cpus); CPU_SET(2,&cpus); CPU_SET(3,&cpus); set_config_tunable(cpu_affinity,cpus);Quoted 1 line
Jan
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________
Le 24/10/2019 à 16:27, Lange Norbert via Xenomai a écrit :
Quoted 48 lines
Nothing has an effect, as the cobalt setup routine binds the main thread to the single core.
See: https://xenomai.org/pipermail/xenomai/2019-August/041381.htmlEvery thread you spawn will inherit the same affinity mask (with a single bit set), and all options (tunables, cmdline) affect the mask *before* the setup then picks the current core as mask. You will need to reset the affinity mask yourself.
Kind regards, Norbert
Quoted 40 lines
-----Original Message-----
From: Xenomai <[email protected]> On Behalf Of Stéphane Ancelot via Xenomai
Sent: Donnerstag, 24. Oktober 2019 16:01
To: Jan Kiszka <[email protected]>; [email protected]
Subject: Re: Process load balancing among CPUNON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR ATTACHMENTS.
Quoted 28 lines · Jan Kiszka
Quoted 16 lines · Stéphane Ancelot
Quoted 15 lines · Jan Kiszka
Quoted 14 lines · Stéphane Ancelot via Xenomai
Hi,
In our system, I noticed maybe a setup problem, or a xenomai related setup problem regarding user processes.
I have 2 user tasks that does not use RT (but xenomai shared memory access), I noticed that if these both tasks were consuming 50% of the CPU they were not migrated on other cpus.
There is no CPU affinity setup in these programs , so I kept the kernel scheduler doing its job.
Is this a bad kernel setting or xenomai setting to allow process cpu migration for user processes ?
Quoted 7 lines
Quoted 2 lines
There is - by design - no automatic load balancing for Xenomai threads. The common case is static schedules /wrt RT task for each CPU.
This is not an RT thread, this is a userspace non rt task linking xenomai heap shared memory.
having a look at this page, the documentation states
cpu_affinityDefaults to any online CPU.As long as that non-RT task is in Linux mode and has an affinity mask that is not reduced to the single core, Linux will happily load-balance it. But if that task went through shadowing by Xenomai, its affinity mask was likely reduced.
That did it :
cpu_set_t my_set;CPU_ZERO(&my_set);CPU_SET(0,&my_set);CPU_SET(1,&my_set);
..
if (sched_setaffinity(0, sizeof(cpu_set_t), &my_set) < 0) {
perror("sched_setaffinity");
}Quoted 34 lines
Quoted 12 lines
A tunable should permit to change it, but it has no effect
cpu_set_t cpus; CPU_ZERO(&cpus); CPU_SET(0,&cpus); CPU_SET(1,&cpus); CPU_SET(2,&cpus); CPU_SET(3,&cpus); set_config_tunable(cpu_affinity,cpus);Quoted 1 line
Jan
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________