Co je /dev/shm?

Anti.Trust antitrust na centrum.sk
Neděle Květen 2 15:12:50 CEST 2004


Tomas Janousek wrote:

> Sun, May 02, 2004 at 02:50:53PM +0200  Anti.Trust napsal:
> 
>>PS: Ozaj je to dobre aj na porovnanie vykonosti HDD voci RAM (naposledy 
>>som to skusal v 92-95? v DOSe [hrali sme Dooma z RAMdisku :))] a odvtedy 
>>nebol cas pod Win a znalosti na Lin :). Nejde ani tak o kopirovanie, ale 
>>pristup je uzasny!
> 
> Zkuste i ramfs, ten nema vubec pevnou velikost a roztahuje se v RAMce jak
> potrebujete.

Dik, prave tmpfs sa mi pacil ^ nebolo potrebne nic nastavovat - pohral 
som sa a koniec :), ide sa pracovat.

Ale dik za recommandation.

AT

PS:
IMHO sa mylite:
Everything in tmpfs is temporary in the sense that no files will be
created on your hard drive. If you unmount a tmpfs instance,
everything stored therein is lost.

tmpfs puts everything into the kernel internal caches and grows and
shrinks to accommodate the files it contains and is able to swap
unneeded pages out to swap space. It has maximum size limits which can
be adjusted on the fly via 'mount -o remount ...'

If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them.

Since tmpfs lives completely in the page cache and on swap, all tmpfs
pages currently in memory will show up as cached. It will not show up
as shared or something like that. Further on you can check the actual
RAM+swap use of a tmpfs instance with df(1) and du(1).







Další informace o konferenci Linux