All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Perrine Martignoni <perrmart@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problem with pthread_setschedparam
Date: Wed, 09 May 2007 14:34:42 +0200	[thread overview]
Message-ID: <4641BFE2.1090108@domain.hid> (raw)
In-Reply-To: <7289437c0705090431x28f68aacxd4f28da514dff60c@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]

Perrine Martignoni wrote:
> On 5/9/07, *Gilles Chanteperdrix* <gilles.chanteperdrix@xenomai.org
> <mailto:gilles.chanteperdrix@xenomai.org>> wrote:
> 
>     Perrine Martignoni wrote:
>     > Hello,
>     >
>     > I've build a xenomai test application with Posix skin wich run on an
>     > ARM9. The application works well one time, and when I want to launch
>     > again my application, I have this error message :
>     >
>     >
>     > Xenomai Posix skin init: pthread_setschedparam: Resource temporarily
>     > unavailable
>     >
>     >
>     >
>     > I think something was bad cancelled but I don't see.
> 
>     Resource temporarily unavailable is EAGAIN, it means that there is not
>     enough memory to create the real-time thread. Could you send us the
>     contents of /proc/xenomai/heap before and after running your
>     application  ?
> 
> I have exactly the same problem with cyclictest.
>  
> And here is the context of /proc/xenomai/heap before :
>  
> size=130560:used=64:pagesz=512
>  
> and after :
>  
> 
> size=130560:used=64:pagesz=512
> 
>  
> 
> It doesn't change.

Ok, I will check this at home, since the ARM I have at work behaves
differently.

If you have some spare time, could you apply the attached patch,
recompile the kernel, and run your application ? This patch prints in
the kernel console which step in pthread_setschedparam returns an error.

-- 
                                                 Gilles Chanteperdrix

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xeno-syscall-print-error.diff --]
[-- Type: text/x-patch; name="xeno-syscall-print-error.diff", Size: 1063 bytes --]

Index: ksrc/skins/posix/syscall.c
===================================================================
--- ksrc/skins/posix/syscall.c	(révision 2429)
+++ ksrc/skins/posix/syscall.c	(copie de travail)
@@ -202,13 +202,19 @@
 
 	err = pthread_create(&k_tid, &attr, NULL, NULL);
 
-	if (err)
+	if (err) {
+		printk("pthread_create returned %d\n", err);
 		return ERR_PTR(-err);
+	}
 
 	err = xnshadow_map(&k_tid->threadbase, NULL);
+	if (err)
+		printk("xnshadow_map returned %d\n", err);
 
-	if (!err && !__pthread_hash(hkey, k_tid))
+	if (!err && !__pthread_hash(hkey, k_tid)) {
+		printk("pthread_hash returned NULL\n");
 		err = -EAGAIN;
+	}
 
 	if (err)
 		pse51_thread_abort(k_tid, NULL);
@@ -244,8 +250,10 @@
 		/* If the syscall applies to "current", and the latter is not
 		   a Xenomai thread already, then shadow it. */
 		k_tid = __pthread_shadow(curr, &hkey);
-		if (IS_ERR(k_tid))
+		if (IS_ERR(k_tid)) {
+			printk("__pthread_shadow: %d\n", PTR_ERR(k_tid));
 			return PTR_ERR(k_tid);
+		}
 
 		promoted = 1;
 	}

  reply	other threads:[~2007-05-09 12:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-09  8:55 [Xenomai-help] Problem with pthread_setschedparam Perrine Martignoni
2007-05-09  9:05 ` Gilles Chanteperdrix
2007-05-09  9:32 ` Gilles Chanteperdrix
2007-05-09 11:31   ` Perrine Martignoni
2007-05-09 12:34     ` Gilles Chanteperdrix [this message]
     [not found] <mailman.51.1178704831.10156.xenomai@xenomai.org>
2007-05-09 12:49 ` Noren, Andrew
2007-05-09 13:32   ` Gilles Chanteperdrix
2007-05-09 13:43     ` Perrine Martignoni
2007-05-09 14:35       ` Perrine Martignoni
2007-05-09 20:37         ` Gilles Chanteperdrix
2007-05-09 21:23           ` Gilles Chanteperdrix
2007-05-09 22:02             ` Philippe Gerum
     [not found]               ` <17986.20728.617772.991566@domain.hid>
     [not found]                 ` <1178784303.11688.108.camel@domain.hid>
2007-05-10  8:34                   ` Gilles Chanteperdrix
2007-05-10  8:41                     ` Gilles Chanteperdrix
2007-05-10  8:58                     ` Daniel Schnell
2007-05-10  9:12                       ` Gilles Chanteperdrix
2007-05-14  9:17                         ` Daniel Schnell
2007-05-14  9:49                           ` Wolfgang Grandegger
2007-05-14  9:56                             ` Daniel Schnell
2007-05-18  9:58                               ` Wolfgang Grandegger
2007-05-10  9:26                     ` Philippe Gerum
2007-05-10  9:33                       ` Gilles Chanteperdrix
2007-05-10 11:41                         ` Perrine Martignoni
2007-05-10 12:06                           ` Gilles Chanteperdrix
2007-05-10 12:47                             ` Perrine Martignoni
2007-05-10 12:53                               ` Gilles Chanteperdrix
2007-05-10 14:40                         ` Philippe Gerum
2007-05-10 14:53                           ` Gilles Chanteperdrix
2007-05-10 15:21                             ` Philippe Gerum
2007-05-10 15:45                               ` Gilles Chanteperdrix
2007-05-11  7:56                                 ` Perrine Martignoni
2007-05-11  8:17                                   ` Gilles Chanteperdrix
2007-05-11  8:24                                     ` Perrine Martignoni
2007-05-11  8:30                                       ` Perrine Martignoni
2007-05-11  8:50                                 ` 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=4641BFE2.1090108@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=perrmart@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.