* [Xenomai] q on rt_task_self() and mode switching
@ 2013-07-08 13:23 Michael Haberler
2013-07-08 13:37 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Michael Haberler @ 2013-07-08 13:23 UTC (permalink / raw)
To: xenomai@xenomai.org
if a userland RT thread gets modeswitched, the SIGXCPU handler obviously still executes in the RT domain, at least rt_task_self() returns a valid task descriptor - fine.
If a kernel RT thread misses the release point, it seems the thread is immediately switched to linux scheduling - or at least rt_task_self() returns NULL in this scenario:
int result = rt_task_wait_period(&overruns);
switch (result) {
case -ETIMEDOUT: // release point was missed
task = rt_task_self(); // this returns NULL
not a big thing - I just would like to get at the thread name for error message purposes; any way to do this?
- Michael
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai] q on rt_task_self() and mode switching
2013-07-08 13:23 [Xenomai] q on rt_task_self() and mode switching Michael Haberler
@ 2013-07-08 13:37 ` Philippe Gerum
2013-07-08 13:45 ` Michael Haberler
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2013-07-08 13:37 UTC (permalink / raw)
To: Michael Haberler; +Cc: xenomai@xenomai.org
On 07/08/2013 03:23 PM, Michael Haberler wrote:
> if a userland RT thread gets modeswitched, the SIGXCPU handler obviously still executes in the RT domain,
Nope. All regular signal handlers are executed in the linux domain.
Xenomai 2.x does not provide real-time signal handlers fired from
primary mode.
at least rt_task_self() returns a valid task descriptor - fine.
>
> If a kernel RT thread misses the release point, it seems the thread is immediately switched to linux scheduling
With Xenomai 2.x, there is no migration to secondary mode for a
kernel(-only) RT thread.
- or at least rt_task_self() returns NULL in this scenario:
>
> int result = rt_task_wait_period(&overruns);
> switch (result) {
>
> case -ETIMEDOUT: // release point was missed
> task = rt_task_self(); // this returns NULL
>
>
> not a big thing - I just would like to get at the thread name for error message purposes; any way to do this?
>
Certainly, but which context does the code above run? On top of some
ioctl()?
> - Michael
>
>
>
>
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> http://www.xenomai.org/mailman/listinfo/xenomai
>
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai] q on rt_task_self() and mode switching
2013-07-08 13:37 ` Philippe Gerum
@ 2013-07-08 13:45 ` Michael Haberler
2013-07-08 13:55 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Michael Haberler @ 2013-07-08 13:45 UTC (permalink / raw)
To: xenomai@xenomai.org
Am 08.07.2013 um 15:37 schrieb Philippe Gerum <rpm@xenomai.org>:
> On 07/08/2013 03:23 PM, Michael Haberler wrote:
>> if a userland RT thread gets modeswitched, the SIGXCPU handler obviously still executes in the RT domain,
>
>
> Nope. All regular signal handlers are executed in the linux domain. Xenomai 2.x does not provide real-time signal handlers fired from primary mode.
>
> at least rt_task_self() returns a valid task descriptor - fine.
>>
>> If a kernel RT thread misses the release point, it seems the thread is immediately switched to linux scheduling
>
> With Xenomai 2.x, there is no migration to secondary mode for a kernel(-only) RT thread.
>
> - or at least rt_task_self() returns NULL in this scenario:
>>
>> int result = rt_task_wait_period(&overruns);
>> switch (result) {
>>
>> case -ETIMEDOUT: // release point was missed
>> task = rt_task_self(); // this returns NULL
>>
>>
>> not a big thing - I just would like to get at the thread name for error message purposes; any way to do this?
>>
>
> Certainly, but which context does the code above run? On top of some ioctl()?
from the RT thread, which is started by a kernel module
- Michael
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai] q on rt_task_self() and mode switching
2013-07-08 13:45 ` Michael Haberler
@ 2013-07-08 13:55 ` Philippe Gerum
2013-07-08 14:03 ` Michael Haberler
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2013-07-08 13:55 UTC (permalink / raw)
To: Michael Haberler; +Cc: xenomai@xenomai.org
On 07/08/2013 03:45 PM, Michael Haberler wrote:
>
> Am 08.07.2013 um 15:37 schrieb Philippe Gerum <rpm@xenomai.org>:
>
>> On 07/08/2013 03:23 PM, Michael Haberler wrote:
>>> if a userland RT thread gets modeswitched, the SIGXCPU handler obviously still executes in the RT domain,
>>
>>
>> Nope. All regular signal handlers are executed in the linux domain. Xenomai 2.x does not provide real-time signal handlers fired from primary mode.
>>
>> at least rt_task_self() returns a valid task descriptor - fine.
>>>
>>> If a kernel RT thread misses the release point, it seems the thread is immediately switched to linux scheduling
>>
>> With Xenomai 2.x, there is no migration to secondary mode for a kernel(-only) RT thread.
>>
>> - or at least rt_task_self() returns NULL in this scenario:
>>>
>>> int result = rt_task_wait_period(&overruns);
>>> switch (result) {
>>>
>>> case -ETIMEDOUT: // release point was missed
>>> task = rt_task_self(); // this returns NULL
>>>
>>>
>>> not a big thing - I just would like to get at the thread name for error message purposes; any way to do this?
>>>
>>
>> Certainly, but which context does the code above run? On top of some ioctl()?
>
> from the RT thread, which is started by a kernel module
>
I still don't see how rt_task_self() could ever return a NULL pointer in
this case. What does xnpod_current_thread()->name give you in the same
context?
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai] q on rt_task_self() and mode switching
2013-07-08 13:55 ` Philippe Gerum
@ 2013-07-08 14:03 ` Michael Haberler
0 siblings, 0 replies; 5+ messages in thread
From: Michael Haberler @ 2013-07-08 14:03 UTC (permalink / raw)
To: xenomai@xenomai.org
Am 08.07.2013 um 15:55 schrieb Philippe Gerum <rpm@xenomai.org>:
>>> Certainly, but which context does the code above run? On top of some ioctl()?
>>
>> from the RT thread, which is started by a kernel module
>>
>
> I still don't see how rt_task_self() could ever return a NULL pointer in this case. What does xnpod_current_thread()->name give you in the same context?
sorry, pls disregard, my fault - trivial #define missing. rt_task_self() works fine as advertised in kernel too.
- Michael
>
> --
> Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-08 14:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-08 13:23 [Xenomai] q on rt_task_self() and mode switching Michael Haberler
2013-07-08 13:37 ` Philippe Gerum
2013-07-08 13:45 ` Michael Haberler
2013-07-08 13:55 ` Philippe Gerum
2013-07-08 14:03 ` Michael Haberler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.