[uClibc] mmaps for malloc should be private

Alexandre Oliva aoliva at redhat.com
Tue Mar 23 04:50:12 UTC 2004


On Mar 22, 2004, David McCullough <davidm at snapgear.com> wrote:

> Ok,  I have never bumped into frv-uclinux.  A quick Google didn't
> show up any sites where I could look at the source etc.  Do you have a
> pointer to it ?  All I can find are gcc/binutils references and a few
> hints of the uClinux port for it.

I posted big patches here.  Eric merged most of them in, but some of
the dynamic loader changes are yet to be merged.  I can send you a
patch if you're interested.

> Do you have full shared libraries working under frv-uclinux ?

Yup.

> If you look in linux-2.4.x/mmnommu/mmap.c you will find that all uClinux
> ports on uclinux.org do not support private mappings.

> http://cvs.uclinux.org/cgi-bin/cvsweb/uClinux-2.4.x/mmnommu/mmap.c?rev=1.21&content-type=text/x-cvsweb-markup

You seem to be looking at the `if (file)' case.  As I pointed out
before, the case at hand is the MAP_ANON one.  It works just fine.

> Search for "Get the NO_MM specific checks done first" in do_mmap_pgoff.

Ah, that.  Hmm...  Looks like the kernel we're using doesn't have the
second test.  Oh, well...  This sucks.  I'll have to talk to our
kernel engineer.  This is too bad.  If this can't be fixed, I guess
my patch for fork() should no go in either.

> The first is obvious,  it isn't possible.  The second is arguable.

Yup.

> I believe the reasoning for this check is that you cannot have a private
> mapping under uclinux as all memory is accessable.  This check forces
> people to think about the NOMMUness of their target a little.  Not sure
> I agree with it myself,  but it has been there a long time.

Even if memory is still shared, because there's no way around it, I'd
rather be able to think of multiple processes as each having its own
separate piece of memory.  But that's just me :-)

> Fair enough.  So the FRV has MMU and NOMMU variants that are instruction
> set compatible ?

Except for the few instructions that have to do with MMU set up, yes.

> Sounds like an interesting platform.  What sort of
> bogoMIPs, internal devices etc do you get with one of these ?

I don't really know, I haven't got close to actual hardware (others in
the development team have), and I don't have performance figures
myself.  I suppose you might want to google for the Fujitsu Venus
architecture and its actual hardware implementations.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the uClibc mailing list