On 15 April 2013 16:40, Phong Vo <[email protected]> wrote:
>
> The default size of the mapped memory for a stream is driven by a #define
> in a header file so it isn't hard to change it. I believe an application can
> also use sfsetbuf(f, NULL, size) to set a desired size for the mapped buffer.
>
> Generally speaking, Sfio and our other core libraries like CDT and Vmalloc
> have been around for a very long time and their default parameters tend to
> stay as they are until someone notices a performance issue. Well, not so much
> for Vmalloc anymore because it has been completely rewritten recently to deal
> with concurrency, both multiple threads and multiple processes for shared 
> memory.
>
> Anyway, it is good that you bring up this issue with Sfio now.
> What do people think is a reasonable size to set the default mapped
> size to on a 64-bit machine? Keep in mind that there apps with many dozens
> files opened at the same time along with other large requirements for memory.

64-bit machines have plenty of address space. Theory aside we've
tested the patch Roland Mainz submitted and we found that it solved
all instances of excessive mmap() syscalls AND allows ksh93 to benefit
from largepages on Solaris 11.1.

Rudimentary testcase from Solaris 11.1 with tmpfs as filesystem shows
that 2M pages are used:
(for ((i=0 ; i < 20 ; i++)) ; do cat /usr/pub/UTF\-8 ; done) >tmp
./arch/sol11.i386-64/bin/ksh -c 'x=$(/bin/cat tmp) ; true'
pmap -s 601 | grep -F 2M
FFFFFD7FF8600000      43008K   2M rw---  dev:557,2 ino:443010149

The pmap output shows that the mmap() call for the results from the
command substitution uses 2Mbytes pages instead of the x86 default
page size of 4096bytes!!!

Thumbs up for that patch!

Lionel
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to