All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Webb <jeff.webb@domain.hid>
To: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] max size for pipes and rt-fifos?
Date: Mon, 11 Sep 2006 15:29:38 -0500	[thread overview]
Message-ID: <4505C732.5030507@domain.hid> (raw)
In-Reply-To: <1157817917.5033.19.camel@domain.hid>

Philippe Gerum wrote:
> The following patch against stock 2.2.2 improves the RTAI fifo
> emulation. It reduces the overhead induced by sending highly scattered
> data over a short period of time, and basically provides a much saner
> implementation.
> 
> I'd be interested to have some feedback about this; I plan to change the
> data streaming mode of message pipes from the native API the same way.
> TIA,

I applied this patch on my linux-2.6 and 2.4 systems.  The simple 'fifotestk.c' example I posted now works fine, with no apparent memory leaks.  I can now allocate a 128 MB RTAI FIFO, which sure beats 100 KB!  Thanks for the fix!

If I try to allocate a FIFO larger than the available vmalloc space, the rtf_create routine now fails with ENOMEM, which is much better than failing on the rtf_put call.  Unfortunately, the RT-FIFO device is now EBUSY forever.  I can switch to another device, and I can allocate space for my 128 MB FIFO once again, so that is good, at least.  Here is the printk output from my program:

[ 128 MB allocation, which works ....]

Sep 11 14:43:26 kernel: fifotest_init
Sep 11 14:43:26 kernel: rtf_create returned: 2
Sep 11 14:43:26 kernel: rtf_put: 6
Sep 11 14:43:29 kernel: fifotest_cleanup
Sep 11 14:43:29 kernel: rtf_destroy returned: 0
Sep 11 14:43:32 kernel: fifotest_init
Sep 11 14:43:32 kernel: rtf_create returned: 2
Sep 11 14:43:32 kernel: rtf_put: 6
Sep 11 14:43:35 kernel: fifotest_cleanup
Sep 11 14:43:35 kernel: rtf_destroy returned: 0

[switched to 256 MB allocation here... should fail]

Sep 11 14:44:29 kernel: fifotest_init
Sep 11 14:44:29 kernel: rtf_create returned: -12
Sep 11 14:44:29 kernel: rtf_put: -22
Sep 11 14:44:33 kernel: fifotest_cleanup
Sep 11 14:44:33 kernel: rtf_destroy returned: -22

[switched back to 128 MB allocation, but the device is now busy...]

Sep 11 14:44:45 kernel: fifotest_init
Sep 11 14:44:45 kernel: rtf_create returned: -16
Sep 11 14:44:45 kernel: rtf_put: -16
Sep 11 14:44:48 kernel: fifotest_cleanup
Sep 11 14:44:48 kernel: rtf_destroy returned: -16


I modified my program to check the return value of rtf_create, but I still have the same problem:


Sep 11 15:15:23 kernel: fifotest_init
Sep 11 15:15:23 kernel: rtf_create returned: 1
Sep 11 15:15:23 kernel: rtf_put: 6
Sep 11 15:15:31 kernel: fifotest_cleanup
Sep 11 15:15:31 kernel: rtf_destroy returned: 0
Sep 11 15:15:33 kernel: fifotest_init
Sep 11 15:15:33 kernel: rtf_create returned: 1
Sep 11 15:15:33 kernel: rtf_put: 6
Sep 11 15:15:35 kernel: fifotest_cleanup
Sep 11 15:15:35 kernel: rtf_destroy returned: 0
Sep 11 15:15:51 kernel: fifotest_init
Sep 11 15:15:51 kernel: rtf_create returned: -12
Sep 11 15:15:51 kernel: could not create FIFO
Sep 11 15:16:05 kernel: fifotest_init
Sep 11 15:16:05 kernel: rtf_create returned: -16
Sep 11 15:16:05 kernel: could not create FIFO

Thanks!

-Jeff



  reply	other threads:[~2006-09-11 20:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 21:14 [Xenomai-help] max size for pipes and rt-fifos? Jeff Webb
2006-09-07  9:23 ` Jan Kiszka
2006-09-07 19:53   ` Jeff Webb
2006-09-08  6:55     ` Jan Kiszka
2006-09-11 20:03       ` Jeff Webb
2006-09-11 20:49         ` Gilles Chanteperdrix
2006-09-11 22:29           ` Jan Kiszka
2006-09-12 11:29             ` Gilles Chanteperdrix
2006-09-08 13:59     ` Philippe Gerum
2006-09-09 16:05       ` Philippe Gerum
2006-09-11 20:29         ` Jeff Webb [this message]
2006-09-11 21:15           ` 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=4505C732.5030507@domain.hid \
    --to=jeff.webb@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.