problems with mmap() and disk caching

Andrey Zonov andrey at zonov.org
Fri Apr 6 06:45:12 UTC 2012


On 05.04.2012 23:54, Andrey Zonov wrote:
> On 05.04.2012 23:41, Konstantin Belousov wrote:
>> You do use UFS, right ?
>
> Yes.
>

I've run test on ZFS.

Mem: 2645M Active, 363M Inact, 2042M Wired, 1406M Buf, 42G Free

$ ./mmap /mnt/random

Mem: 3669M Active, 363M Inact, 3067M Wired, 1406M Buf, 40G Free

It eats 2Gb as I understand.

# umount /mnt
# zfs mount -a

Mem: 2645M Active, 363M Inact, 2042M Wired, 1406M Buf, 42G Free

$ cat /mnt/random > /dev/null

Mem: 2645M Active, 363M Inact, 3067M Wired, 1406M Buf, 41G Free

That's correct - 1Gb.

About "Buf" memory.  Is this reasonable to set it to 10% of physical 
memory?  I've lost 10Gb by default on machines with 96Gb.

-- 
Andrey Zonov


More information about the freebsd-hackers mailing list