All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Ronny Meeus <ronny.meeus@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] [xenomai-forge] timer-internal consume a lot of cpu
Date: Tue, 16 Dec 2014 21:07:22 +0100	[thread overview]
Message-ID: <549090FA.7000901@xenomai.org> (raw)
In-Reply-To: <CAMJ=MEfzrJQGYKT41F2hSirn8q0MGt-kWuT2GYQE7YTbSCNG5A@mail.gmail.com>

On 12/16/2014 08:41 PM, Ronny Meeus wrote:
> On Tue, Dec 16, 2014 at 6:58 PM, Philippe Gerum <rpm@xenomai.org> wrote:
>> On 12/16/2014 06:36 PM, Ronny Meeus wrote:
>>> On Sun, Dec 7, 2014 at 5:26 PM, Ronny Meeus <ronny.meeus@gmail.com> wrote:
>>>> Hello
>>>>
>>>> we are using the xenomai-forge implementation.
>>>> We from time to time see an issue that the timer-internal thread is
>>>> consuming a complete core. It is seen when we send broadcast traffic that
>>>> needs to be handled by the Linux kernel (ARP).
>>>>
>>>> The kernel thread's priority handling the packets in the middle between the
>>>> timer-internal thread and the application thread's priority. All threads run
>>>> on the same core.
>>>> If the priority of the timer-internal is lowered below the kernel thread,
>>>> the load disappears immediately.
>>>> So it looks like there is some busy polling on a common resource that is
>>>> currently held by the application thread running at the lowest prio.
>>>>
>>>> I see that the timer lock being used is a mutex with priority inheritance so
>>>> I would expect that the prio of the application is raised as soon as the
>>>> timer-internal thread tries to obtain the mutex.
>>>
>>> After investigating this issue in more detail I have the impression that it has
>>> nothing to do with the mutex used to protect the timer but with the conditional
>>> variable used to implement the psos event interface.
>>>
>>> I found references on the web that explain an issue with the internal mutex used
>>> inside the posix library to implement a conditional variable. See:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=438484
>>> http://marc.info/?t=134688711000002&r=1&w=2
>>>
>>> If this is indeed true, it means that the usage of conditional
>>> variables is not safe
>>> at all (from priority inheritance point of view).
>>
>> Yes, condvars are known not to work nicely with PI mutexes on the glibc.
> 
> Philippe,
> I do not understand.
> 
> We just use the pSOS interface of the xenomai-forge, which internally uses
> conditional variables.
> Does this mean that we cannot use the pSOS interface with glibc?
> 
> If above statement is correc, what libc should we use to make it work?
> 

A release of the glibc that fixes this issue. I must admit that I did
not track this problem lately. Jan likely knows better here.

-- 
Philippe.


  reply	other threads:[~2014-12-16 20:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07 16:26 [Xenomai] [xenomai-forge] timer-internal consume a lot of cpu Ronny Meeus
2014-12-16 17:36 ` Ronny Meeus
2014-12-16 17:58   ` Philippe Gerum
2014-12-16 19:41     ` Ronny Meeus
2014-12-16 20:07       ` Philippe Gerum [this message]
2014-12-18  8:00         ` Ronny Meeus
2014-12-18  9:04           ` Jan Kiszka
2014-12-18 12:28             ` Ronny Meeus
2014-12-18 13:35               ` Jan Kiszka
2014-12-18 14:17                 ` Ronny Meeus
2014-12-18 14:12               ` Gilles Chanteperdrix
2014-12-18 14:58                 ` Jan Kiszka
2014-12-18 15:04                   ` Gilles Chanteperdrix
2014-12-18 15:25                     ` Ronny Meeus
2014-12-18 15:30                       ` Gilles Chanteperdrix
2014-12-18 15:35                         ` Jan Kiszka
2014-12-18 15:49                           ` Ronny Meeus
2014-12-18 16:06                             ` Jan Kiszka
2014-12-18 17:21                               ` Ronny Meeus
2014-12-23 17:36                                 ` Ronny Meeus
2015-01-23 16:45                                   ` Philippe Gerum

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=549090FA.7000901@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=ronny.meeus@gmail.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.