From: Philippe Gerum <rpm@xenomai.org>
To: Mitchell Tasman <tasman@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Handler executed on behalf of rtdm_nrtsig_pend() appears to be running in Linux hardirq, rather than softirq, context
Date: Thu, 02 Feb 2012 10:03:40 +0100 [thread overview]
Message-ID: <4F2A516C.6000902@domain.hid> (raw)
In-Reply-To: <4F29DE8A.3080009@domain.hid>
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.
prev parent reply other threads:[~2012-02-02 9:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F2A516C.6000902@domain.hid \
--to=rpm@xenomai.org \
--cc=tasman@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.