[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] shmat issue
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] shmat issue |
Date: |
Wed, 20 Oct 2010 11:53:05 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Oct 20, 2010 at 02:30:12PM -0400, Philip Balister wrote:
> On 10/20/2010 01:49 PM, Eric Blossom wrote:
> >On Wed, Oct 20, 2010 at 01:02:15PM -0400, Philip Balister wrote:
> >>On 10/19/2010 10:51 PM, Eric Blossom wrote:
> >>OK, it looks like x86 sets SHMLBA to PAGE_SIZE and arm uses 4 *
> >>PAGE_SIZE. Need to puzzle through this a little more. This is the
> >>failing check in the kernel.
> >
> >OK. What's PAGE_SIZE on arm?
>
> PAGE_SIZE is still 4096, there is an additional restriction on the
> address passed to shmat().
>
> >
> >I wonder how we can determine the actual value of SHMLBA at runtime?
> >We currently use the result of gr_pagesize() as the required alignment value.
>
> It looks to me like the there are several shm sections created, with
> varying access rights. Then shmat is used to reserve a chunk of
> memory. Then the sections created first are attached to with
> addresses based on the result of the shmat used to get the address
> space.
>
> The weird thing on arm, the shmat returns a page aligned section,
> but if you pass that address back to shmat it fails, because that
> address needs to be aligned to SHMLBA (found in
> arch/arm|x86/include/asm/shmparam.h.
>
> What does it mean?
>
> Well gnuradio falls back to a mmap approach to get the circular
> buffer. It is a bigger problem for kalibrate, which just fails.
>
> I'm not sure who is to blame :) Is there another way to get reserve
> the memory on you process to use when you attach the shared memory
> segments?
Philip,
If you run "make check", it will probe for an implementation that
works. Under *unix variants, there are three different
implementations that are tried:
gr_vmcircbuf_sysv_shm.cc
gr_vmcircbuf_mmap_shm_open.cc
gr_vmcircbuf_mmap_tmpfile.cc
Under windows, it uses
gr_vmcircbuf_createfilemapping.cc
Since you're probably not going to get make check working in our
lifetimes, try this:
$ echo -n "gr_vmcircbuf_mmap_shm_open_factory" >
~/.gnuradio/prefs/gr_vmcircbuf_default_factory
Or this:
$ echo -n "gr_vmcircbuf_mmap_tmpfile_factory" >
~/.gnuradio/prefs/gr_vmcircbuf_default_factory
Even if they both work, they may have different runtime performance. YMMV...
Eric
- [Discuss-gnuradio] shmat issue, Philip Balister, 2010/10/19
- Re: [Discuss-gnuradio] shmat issue, Eric Blossom, 2010/10/19
- Re: [Discuss-gnuradio] shmat issue, Philip Balister, 2010/10/20
- Re: [Discuss-gnuradio] shmat issue, Eric Blossom, 2010/10/20
- Re: [Discuss-gnuradio] shmat issue, Philip Balister, 2010/10/20
- Re: [Discuss-gnuradio] shmat issue,
Eric Blossom <=
- Re: [Discuss-gnuradio] shmat issue, Joshua Lackey, 2010/10/25
- Re: [Discuss-gnuradio] shmat issue, Philip Balister, 2010/10/26
- Re: [Discuss-gnuradio] shmat issue, Joshua Lackey, 2010/10/26