All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: NZG <ngustavson@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Fwd: can't use message pipe - Cannot allocate	memory
Date: Thu, 07 Jun 2007 19:19:06 +0200	[thread overview]
Message-ID: <1181236746.4998.122.camel@domain.hid> (raw)
In-Reply-To: <1181235786.4998.108.camel@domain.hid>

On Thu, 2007-06-07 at 19:03 +0200, Philippe Gerum wrote:
> On Thu, 2007-06-07 at 10:49 -0500, NZG wrote:
> > I'm trying to pass a message from user space to Xenomai and it doesn't seem
> >  to be working. I keep getting an error when attempting to write to the pipe
> >  in user space.
> > 
> > rt_pipe_write error
> > 
> > : Cannot allocate memory
> > 
> 
> Issue confirmed here when passing a non-zero poolsize. Passing 0 does
> not seem to exhibit the problem. Could you re-check that both cases
> actually fail on your side?
> 
> I have crafted a quick and dirty demo showing the problem. Until a
> non-zero value is passed to rt_pipe_create() to specify a local pool,
> everything is ok. (note: we could have used rt_pipe_write/rt_pipe_read
> indifferently, they both end up calling rt_pipe_send/receive).
> 
> I'll have a look at this asap.

This is "normal" behaviour, albeit peculiar. Local pools for pipes are
created on the fly, when the poolsize argument is non-zero, in which
case, a real-time heap is created to manage the message pool behind the
curtains. The init routine for real-time heaps will bail out when the
required size is lower than two times the VM page size, plus some
overhead induced by the meta-data, all rounded to the VM page size for
your achitecture.

In other words, on x86 for instance, you cannot create heaps smaller
than ((4096 * 2) + align(overhead,4096)) bytes, which also apply to
local message pools for pipes. Try passing 16384 to the poolsize
argument to see if things get better.

Obviously, if passing 0 still bugs for you, then we would still have
another problem to solve.

-- 
Philippe.




  reply	other threads:[~2007-06-07 17:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 15:49 [Xenomai-help] Fwd: can't use message pipe - Cannot allocate memory NZG
2007-06-07 17:03 ` Philippe Gerum
2007-06-07 17:19   ` Philippe Gerum [this message]
2007-06-07 18:11     ` NZG
2007-06-07 18:22       ` Jan Kiszka
2007-06-07 18:37         ` NZG
2007-06-07 19:27           ` Jan Kiszka
2007-06-07 19:39             ` NZG
2007-06-07 20:15             ` Philippe Gerum
2007-06-07 22:29             ` Philippe Gerum
2007-06-07 22:47               ` Jan Kiszka
2007-06-08  6:55                 ` [Xenomai-core] " 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=1181236746.4998.122.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=ngustavson@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.