From: Jan Kiszka <jan.kiszka@siemens.com>
To: Mariusz Janiak <mariuszjaniak@wp.pl>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] SIGXCPU with rt_mutex_release
Date: Tue, 08 Jan 2013 14:33:59 +0100 [thread overview]
Message-ID: <50EC2047.1060304@siemens.com> (raw)
In-Reply-To: <50ebff2e488690.18102992@wp.pl>
On 2013-01-08 12:12, Mariusz Janiak wrote:
> Hi GIlles,
>
> As you suggested, I have prepared simple test case that demonstrate how Xenomai is utilized by OROCOS. This test case behaves exactly the same like helloword example. Scheduler is chosen before any mutex are processed, so in my opinion it is not the case which you defined. What is really surprising is that the replacing TM_NONBLOCK with TM_INFINITE, in one before last line, do magic and suppress signal generation. Furthermore, there is no call to 'rt_task_set_mode(0, T_WARNSW, NULL);' so why
> signal is generated? If we enable T_WARNSW in the thread, SIGXCPU is generated when mutex is locked first time in the thread.
This should cure the issue (there was a check for XNTRAPSW missing):
diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c
index e10be47..c1465dc 100644
--- a/ksrc/nucleus/synch.c
+++ b/ksrc/nucleus/synch.c
@@ -687,10 +687,11 @@ xnsynch_release_thread(struct xnsynch *synch, struct xnthread *lastowner)
#ifdef CONFIG_XENO_OPT_PERVASIVE
if (xnthread_test_state(lastowner, XNOTHER)) {
- if (xnthread_get_rescnt(lastowner) == 0)
- xnshadow_send_sig(lastowner, SIGDEBUG,
- SIGDEBUG_MIGRATE_PRIOINV, 1);
- else
+ if (xnthread_get_rescnt(lastowner) == 0) {
+ if (xnthread_test_state(lastowner, XNTRAPSW))
+ xnshadow_send_sig(lastowner, SIGDEBUG,
+ SIGDEBUG_MIGRATE_PRIOINV, 1);
+ } else
xnthread_dec_rescnt(lastowner);
}
#endif
Thanks for providing the test case.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2013-01-08 13:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 11:12 [Xenomai] SIGXCPU with rt_mutex_release Mariusz Janiak
2013-01-08 13:33 ` Jan Kiszka [this message]
2013-01-08 19:40 ` Gilles Chanteperdrix
2013-01-08 19:43 ` Gilles Chanteperdrix
2013-01-08 21:06 ` Jan Kiszka
2013-01-08 21:09 ` Jan Kiszka
2013-01-09 13:30 ` Jan Kiszka
2013-01-12 18:43 ` Gilles Chanteperdrix
2013-01-13 12:29 ` Jan Kiszka
2013-01-13 12:35 ` Jan Kiszka
2013-01-13 12:52 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2013-01-08 20:51 Mariusz Janiak
2013-01-08 17:42 Mariusz Janiak
2012-12-31 17:32 Mariusz Janiak
2012-12-31 17:41 ` Gilles Chanteperdrix
2012-12-31 17:52 ` Peter Soetens
2012-12-31 17:55 ` Gilles Chanteperdrix
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=50EC2047.1060304@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=mariuszjaniak@wp.pl \
--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.