All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Pierre Quelin <pierre.quelin@free.fr>
Cc: pierre.quelin@solystic.com, xenomai@xenomai.org
Subject: Re: [Xenomai] posix skin pthread_create issue
Date: Wed, 12 Sep 2012 22:27:56 +0200	[thread overview]
Message-ID: <5050F04C.6030707@xenomai.org> (raw)
In-Reply-To: <5050E1F2.8090702@free.fr>

On 09/12/2012 09:26 PM, Pierre Quelin wrote:

> Thank you for quick answer.
> 
> my context
> 
> xenomai : 2.6.0 adeos : 2.11-02 kernel : 2.6.38.8 arch : pentium pro 
> gcc : 4.6.3 distro : Ubuntu 12.04


If you use this version, add "-fno-omit-frame-pointer" to the CFLAGS
passed to the configure script.

> 
> I already read the TROUBLESHOOTING guide but I don't understand all
> the informations contained in //proc/<pid>/maps/. I already try
> "ulimit -s 81920" without success.


You usually want to decrease ulimit -s, not increase it.

> 
> After your answer, I try xenomai 2.6.1 and I increase the size of the
>  private stack pool from 128 to 2048 with the same result.
> 
> Is there any limits for the number of threads in Xenomai ?


Not that I know of. There are only a few dynamic allocations in the
various pools you already mentioned. The corresponding options are:
XENO_OPT_REGISTRY_NRSLOTS (maximum number of objects in the registry,
each thread is registered in the registry)
XENO_OPT_SYS_HEAPSZ (system heap, used for various calls to xnmalloc)
XENO_OPT_SEM_HEAPSZ (semaphore heap, use for allocating 4 bytes per
thread + 4 bytes per mutex)

But anyway, debugging the issue you have should be relatively easy by
adding printfs/printks, starting from src/skins/posix/thread.c (function
__wrap_pthread_create), continuing in ksrc/skins/posix/syscall.c,
function __pthread_create, etc...

> 
> 
> I don't know if there is the link with my problem but I have some 
> strange things.
> 
> With Xenomai 2.6.1, when I launch the latency/switch test I obtain
> some negative values like -1.03µs.


That is a known issue. See for instance:
http://www.blaess.fr/christophe/2012/07/23/les-latences-de-xenomai/


 After mlockall() in
> //proc/xenomai/faults/ I obtain 2 or more Page fault without visible
> software effects. I can't locate it. If you could help me.


> 
> Our application is writting in C++. At the begining it initialise a
> lot of static objects as mutex and do a lot of allocation/syscall. So
> it do a lot of switch in secondary mode. To solve this, at first, I
> just catch the SIGXCPU in a static class..


Well, you should be able to catch the page faults with SIGXCPU, but you
have to ensure that pthread_set_mode and the signal handler installation
are done before the static objects constructors. And of course, you have
to ensure that Xenomai libpthread_rt library constructor gets run before
your static initializers. That is a problem with C++. Also note that
PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER do not work with
Xenomai posix skin.

> 
> 
> Sorry for messages at the end of the mail but I can't remove it
> (!?.§§!! Lotus N..es and security policy) Could you please send me a
> copy of your answer to pierre.quelin@solystic.com


The free.fr address is fine.


-- 
                                                                Gilles.



       reply	other threads:[~2012-09-12 20:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5050E1F2.8090702@free.fr>
2012-09-12 20:27 ` Gilles Chanteperdrix [this message]
     [not found]   ` <50521433.9060807@free.fr>
2012-09-13 18:40     ` [Xenomai] posix skin pthread_create issue Gilles Chanteperdrix
     [not found]       ` <50577AB4.6050006@free.fr>
2012-09-17 19:50         ` Gilles Chanteperdrix
     [not found]           ` <50578C29.8030104@free.fr>
2012-09-17 21:02             ` Gilles Chanteperdrix
2012-09-17 21:07               ` Gilles Chanteperdrix
2012-09-12  8:19 Pierre.QUELIN
2012-09-12  8:29 ` 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=5050F04C.6030707@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=pierre.quelin@free.fr \
    --cc=pierre.quelin@solystic.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.