All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Handler executed on behalf of rtdm_nrtsig_pend() appears to be running in Linux hardirq, rather than softirq, context
@ 2012-02-02  0:53 Mitchell Tasman
  2012-02-02  9:03 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Mitchell Tasman @ 2012-02-02  0:53 UTC (permalink / raw)
  To: xenomai

Xenomai documents rtdm_nrtsig_pend() as follows:

> The signal handler will run in soft-IRQ context of the non-real-time subsystem. Note the implications of this context, e.g. no invocation of blocking operations.

As a result, I would have anticipated that when invoked from within the 
signal handler, in_irq() would return 0, while in_softirq() would return 
non-zero.

Instead, I've found that in_irq() returns the value 0x10000, which 
(digging around in include/linux/hardirq.h) indicates that the hardirq 
count is 1.

A partial Linux kernel stack backtrace, leading up to execution of the 
signal handler, is as follows:

> [  217.844177] [<bf031838>] (my_signalClient+0x24/0x48 [my_rtdm_driver]) from [<c00df42c>] (__ipipe_sync_stage+0x164/0x198)
> [  217.844207] [<c00df42c>] (__ipipe_sync_stage+0x164/0x198) from [<c0058960>] (ipipe_trigger_irq+0x14/0x20)
> [  217.844238] [<c0058960>] (ipipe_trigger_irq+0x14/0x20) from [<c011ca78>] (gatekeeper_thread+0x1ac/0x398)

It seems that there are at least several possibilities:

1.  I've misunderstood the documentation, and the signal handler is 
intended to run in Linux hardirq context.  If so, and I need softirq 
context, I'd need to schedule a tasklet from within the signal handler.

2.  There's something broken about my specific environment.  I am 
presently using a Beagleboard xM Rev C, running a TI 2.6.37-derived OMAP 
kernel from the staging tree on Arago, with a tailored (by me) version 
of the ARM I-pipe patchset for 2.6.37.6 that ships with Xenomai-2.6.0. 
The Xenomai version is also the as-released 2.6.0.

3.  I've discovered a bug (or feature) in the rtdm_nrtsig_pend() 
implementation and/or in the underlying plumbing.

Perhaps someone from the Xenomai community can comment.

Thanks much.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-help] Handler executed on behalf of rtdm_nrtsig_pend() appears to be running in Linux hardirq, rather than softirq, context
  2012-02-02  0:53 [Xenomai-help] Handler executed on behalf of rtdm_nrtsig_pend() appears to be running in Linux hardirq, rather than softirq, context Mitchell Tasman
@ 2012-02-02  9:03 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2012-02-02  9:03 UTC (permalink / raw)
  To: Mitchell Tasman; +Cc: xenomai

On 02/02/2012 01:53 AM, Mitchell Tasman wrote:
> Xenomai documents rtdm_nrtsig_pend() as follows:
>
>> The signal handler will run in soft-IRQ context of the non-real-time
>> subsystem. Note the implications of this context, e.g. no invocation
>> of blocking operations.
>
> As a result, I would have anticipated that when invoked from within the
> signal handler, in_irq() would return 0, while in_softirq() would return
> non-zero.

Actually, nrt_sig runs on behalf of a virtual interrupt, which is a hard 
IRQ context from Linux's standpoint.

>
> Instead, I've found that in_irq() returns the value 0x10000, which
> (digging around in include/linux/hardirq.h) indicates that the hardirq
> count is 1.
>
> A partial Linux kernel stack backtrace, leading up to execution of the
> signal handler, is as follows:
>
>> [ 217.844177] [<bf031838>] (my_signalClient+0x24/0x48
>> [my_rtdm_driver]) from [<c00df42c>] (__ipipe_sync_stage+0x164/0x198)
>> [ 217.844207] [<c00df42c>] (__ipipe_sync_stage+0x164/0x198) from
>> [<c0058960>] (ipipe_trigger_irq+0x14/0x20)
>> [ 217.844238] [<c0058960>] (ipipe_trigger_irq+0x14/0x20) from
>> [<c011ca78>] (gatekeeper_thread+0x1ac/0x398)
>
> It seems that there are at least several possibilities:
>
> 1. I've misunderstood the documentation, and the signal handler is
> intended to run in Linux hardirq context. If so, and I need softirq
> context, I'd need to schedule a tasklet from within the signal handler.
>
> 2. There's something broken about my specific environment. I am
> presently using a Beagleboard xM Rev C, running a TI 2.6.37-derived OMAP
> kernel from the staging tree on Arago, with a tailored (by me) version
> of the ARM I-pipe patchset for 2.6.37.6 that ships with Xenomai-2.6.0.
> The Xenomai version is also the as-released 2.6.0.
>
> 3. I've discovered a bug (or feature) in the rtdm_nrtsig_pend()
> implementation and/or in the underlying plumbing.
>
> Perhaps someone from the Xenomai community can comment.
>
> Thanks much.
>
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>


-- 
Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-02  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-02  0:53 [Xenomai-help] Handler executed on behalf of rtdm_nrtsig_pend() appears to be running in Linux hardirq, rather than softirq, context Mitchell Tasman
2012-02-02  9:03 ` Philippe Gerum

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.