Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/dev/shm is the shared memory implementation in recent kernels. Mounting tmpfs on /dev/shm places it into the kernel shared memory implementation. You should have an entry in /etc/fstab that says:
Code:
tmpfs /dev/shm tmpfs defaults 0 0
Older implementations that do not do this are legacy - they will go away as they are updated by the distribution.
/dev/shm is the shared memory implementation in recent kernels. Mounting tmpfs on /dev/shm places it into the kernel shared memory implementation. You should have an entry in /etc/fstab that says:
Yes, I am aware of all that, and I am currently mounting tmpfs on /dev/shm.
My question is this: If I already have tmpfs mounted on /dev, will that allow POSIX shared memory to work (since /dev/shm will be on a tmpfs?) Or does it need an entire filesystem under /dev/shm?
Why do you care ???.
You won't be "saving" anything.
I will be saving space in my fstab, and simplifying the mount-dance in the bootscripts (/dev/shm is a particularly mean case because its mount point doesn't exist when /dev comes into existence, since /dev is another tmpfs and thus blank; so it stops mount -a -t tmpfs from working, when it would otherwise. Putting individual mount commands in the bootscripts is bad both because it's ugly, and because you have to edit your bootscripts whenever you change your system arrangement.)
I can also reduce the system to two tmpfs's (/dev and /tmp); since my package manager compiles packages in /tmp, and kde caches e.g. web pages there, I have the /tmp max size set to 5G, the same as my swap. This means that when running ram-intensive applications, the tmpfs can be pushed entirely to disk and all the ram made available, but otherwise it will live in unused memory and be really fast. Having two other tmpfs's (which by default set a maximum size of half of physical RAM) means that it is theoretically possible to entirely fill RAM by writing enough to those three filesystems, thus disabling the system; which can be gotten around by setting maxsizes on those, but that's unnecessary complication and restriction if one of them isn't needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.