Re: mmap vs. real memory

From: Chris Friesen
Date: Thu Sep 10 2009 - 19:16:50 EST


On 09/10/2009 04:38 PM, Brian McGrew wrote:

> Now that we are needing more and more shared memory, we're seeing random
> performance issues. With 16MB, 64MB and 256MB (in recent past) all was
> good. But now, trying to allocate 1GB of shared memory, we see it taking
> anywhere from .6 to 9 SEONDS to access the file. No good!
>
> What I'm wondering and needed to do is map a chunk of mymoery (1GB today,
> maybe 2GB later on) so that all my apps can access it. Short of creating a
> ramdisk and moving the mmap'ed file to ramdisk, what is the best way to do
> this???

Maybe make a ramfs partition, mount it somewhere, and create your file
there? This is more efficient and simpler than creating a ramdisk.

Alternately, have you considered using hugetlbfs and mapping the shared
memory with large pages?

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/