From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: peter@thesourceworks.com
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Xenomai warn_upon_switch
Date: Fri, 28 Jun 2013 20:40:12 +0200 [thread overview]
Message-ID: <51CDD88C.5000004@xenomai.org> (raw)
In-Reply-To: <CAMYDobV2YQez7qtcTxxQ1wsL23oPu0sT+WwHsQ6hW18pcgnJkA@mail.gmail.com>
On 06/28/2013 05:35 PM, Peter Soetens wrote:
> On Thu, Jun 27, 2013 at 11:17 AM, Philippe Gerum<rpm@xenomai.org> wrote:
>> On 06/27/2013 11:09 AM, Leopold Palomo-Avellaneda wrote:
>>
>>>
>>> AAnd I don't know how to silent (or if is possible) this messages.
>>
>>
>> Try disabling CONFIG_XENO_OPT_DEBUG_SYNCH_RELAX if currently set in your
>> kernel config. If that is still not enough, then you will have to switch off
>> PTHREAD_WARNSW manually, using pthread_set_mode_np(), for each thread which
>> triggers this signal.
>
> Quoting Gilles:
> "The point is that these messages are telling you that there is a bug,
> either in xenomai code (a bug was fixed since xenomai 2.6.2.1 which
> could explain such a behaviour), or in orocos code. When the bug is
> fixed the signal will disappear."
>
> We're having one thread ( main() ) which is modeswitching all the time
> since it's doing user IO using the console, filesystem etc.
>
> I didn't consider this as a bug, and we only enable PTHREAD_WARNSW for
> specific threads, where it does matter.
What would be a problem would be to change scheduling policy from
SCHED_FIFO to SCHED_OTHER in a section protected by a mutex, you would
then get the signal when releasing the mutex. In this case, when using
xenomai 2.6.2.1, you would get a SIGDEBUG with reason
SIGDEBUG_MIGRATE_PRIOINV reason, after 2.6.2.1 you would get a SIGDEBUG
with reason SIGDEBUG_RESCNT_IMBALANCE.
This is considered as a bug, because if the mutex is shared with other
threads using SCHED_FIFO policy, switching from SCHED_FIFO to
SCHED_OTHER would cause the thread holding the mutex to switch to
secondary mode, and so potentially cause a priority inversion.
But I think we already discussed this a long time ago on this list.
Anyway, a way to know what happens is to print the reason in the signal
handler.
--
Gilles.
next prev parent reply other threads:[~2013-06-28 18:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 7:06 [Xenomai] Xenomai warn_upon_switch Leopold Palomo-Avellaneda
2013-06-26 17:21 ` Gilles Chanteperdrix
2013-06-27 9:09 ` Leopold Palomo-Avellaneda
2013-06-27 9:17 ` Philippe Gerum
2013-06-28 15:35 ` Peter Soetens
2013-06-28 18:40 ` Gilles Chanteperdrix [this message]
2013-06-28 18:52 ` Gilles Chanteperdrix
2013-06-28 23:34 ` Leopold Palomo Avellaneda
2013-06-29 13:17 ` Philippe Gerum
2013-06-29 14:05 ` Gilles Chanteperdrix
2013-06-29 14:22 ` Philippe Gerum
2013-07-01 13:38 ` [Xenomai] Xenomai warn_upon_switch .. kill the user Leopold Palomo-Avellaneda
2013-06-27 12:19 ` [Xenomai] Xenomai warn_upon_switch Gilles Chanteperdrix
2013-06-27 12:31 ` Gilles Chanteperdrix
2013-06-27 12:54 ` Leopold Palomo-Avellaneda
2013-06-27 12:58 ` Gilles Chanteperdrix
2013-06-28 8:44 ` Leopold Palomo-Avellaneda
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=51CDD88C.5000004@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=peter@thesourceworks.com \
--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.