Skip to contentSkip to conversation

secondary mode switches on rt_task_set_priority

Xenomai Henning Schild 2 participants 4 messages Jul 11, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

i was asked to assist debugging a case where a SIGXCPU is received after calling rt_task_set_priority. According to the docs that call should not cause secondary mode switches, but it seems it does. Xenomai 3.0.5 kernel 4.4.43

I did not start digging yet but wanted to ask if someone has already come across that scenario.

Henning

Here some output from the signal-handler:

SIGXCPU signal detected! TID = 12743, reason = -53542910: <unknown>

Backtrace:

application sigxcpu handler /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f133162f3d0] /lib/x86_64-linux-gnu/libc.so.6(__sched_get_priority_max+0x7)[0x7f132f4ffd97] /usr/lib/libcobalt.so.2(cobalt_xlate_schedparam+0x37)[0x7f1331a4fb87] /usr/lib/libcobalt.so.2(pthread_setschedparam_ex+0x31)[0x7f1331a4fdc1] /usr/lib/libcopperplate.so.0(copperplate_renice_local_thread+0x9)[0x7f1331c67c69] /usr/lib/libcopperplate.so.0(threadobj_set_schedparam+0x6a)[0x7f1331c6af1a] /usr/lib/libalchemy.so.0(rt_task_set_priority+0x59)[0x7f1331e81149]

#1 lore raw
Quoted 5 lines · Henning Schild

Hi,

i was asked to assist debugging a case where a SIGXCPU is received after calling rt_task_set_priority. According to the docs that call should not cause secondary mode switches, but it seems it does.

This is a documented issue:
http://xenomai.org/migrating-from-xenomai-2-x-to-3-x/#Scheduling

Quoted 5 lines

Xenomai 3.0.5 kernel 4.4.43

I did not start digging yet but wanted to ask if someone has already come across that scenario.

There is no work around with 3.0.x. There is a build option with the upcoming 3.1 in -next called --enable-lazy-setsched, which defers the priority update on the glibc-side until the target thread switches to secondary mode.

Signature · 1 line
Philippe.
#2 lore raw

Am Tue, 11 Jul 2017 11:45:20 +0200
schrieb Philippe Gerum <[email protected]>:

Quoted 12 lines · Henning Schild
Quoted 5 lines

Hi,

i was asked to assist debugging a case where a SIGXCPU is received after calling rt_task_set_priority. According to the docs that call should not cause secondary mode switches, but it seems it does.

This is a documented issue:
http://xenomai.org/migrating-from-xenomai-2-x-to-3-x/#Scheduling

Quoted 2 lines

Xenomai 3.0.5 kernel 4.4.43

Quoted 8 lines
Quoted 3 lines

I did not start digging yet but wanted to ask if someone has already come across that scenario.

There is no work around with 3.0.x. There is a build option with the upcoming 3.1 in -next called --enable-lazy-setsched, which defers the priority update on the glibc-side until the target thread switches to secondary mode.

So it is known and the call should probably be tagged switch-secondary?

Henning

#3 lore raw
Quoted 19 lines · Henning Schild

Am Tue, 11 Jul 2017 11:45:20 +0200
schrieb Philippe Gerum <[email protected]>:

Quoted 16 lines · Henning Schild
Quoted 5 lines

Hi,

i was asked to assist debugging a case where a SIGXCPU is received after calling rt_task_set_priority. According to the docs that call should not cause secondary mode switches, but it seems it does.

This is a documented issue:
http://xenomai.org/migrating-from-xenomai-2-x-to-3-x/#Scheduling

Quoted 5 lines

Xenomai 3.0.5 kernel 4.4.43

I did not start digging yet but wanted to ask if someone has already come across that scenario.

Quoted 7 lines
Quoted 4 lines

There is no work around with 3.0.x. There is a build option with the upcoming 3.1 in -next called --enable-lazy-setsched, which defers the priority update on the glibc-side until the target thread switches to secondary mode.

So it is known and the call should probably be tagged switch-secondary?

Any patch welcome.

Signature · 1 line
Philippe.