Bug#390184: [Pkg-sysvinit-devel] Bug#390184: initscripts: please limit the size of /lib/init/rw
On Fri, Sep 29, 2006 at 07:39:26PM +0200, Petter Reinholdtsen wrote: [Mario Holbe] I personally think that something around 100k should suffice, but if you like to have it somehow dynamic, I attached a small sample patch which limits the size to one tenth of available memory. Thank you for the patch. If we want dosemu and user-mode-linux to stop using /dev/shm/ to store their mmaped files, and instead use /lib/init/rw/ or similar, the size will have to be a lot higher than 100k. These two filesystems serve fundamentally different purposes, and namespace collisions between those two uses should be avoided at all costs -- by keeping them completely separate. Is there any good reason to combine the two? The overhead of two [sensibly configured] tmpfs filesystems rather than one is minimal. One idea I am considering is to make /dev/shm/ a symlink or bind-mount to a subdirectory /lib/init/rw/shm/, and thus only have one tmpfs file system by default. Please don't do this. Sensible defaults are all that is required in both cases. For /lib/init/rw, this could most likely be set to a tiny amount, like the 100 KiB suggested. For /dev/shm, requirements could be a lot higher, and vary from system to system, but again a sensible default would fix this. The current practice of using the kernel default of 0.5*coresize is wrong. I'm currently safe, having a good 6 GiB of swap, but for high memory systems with less swap than core, you're heading into potential DoS territory with the current approach. On a system with 8 GiB of core, a 4 GiB /lib/init/rw is a waste and a huge liability. Suggestion: choose fixed limits, and allow the user to configure both. /lib/init/rw could be fixed to a specific size, and /dev/shm could be e.g. 0.5*core up to an upper limit of 512 MiB (by default). The current SHM_SIZE in /etc/default/tmpfs is no longer sufficient. Please could you add an INIT_RW_SIZE in addition, and set it by default? (As in the patch). Also, given the widely differing sizes of the various tmpfs filesystems, TMPFS_SIZE is not really all that useful any more. Could this be deprecated or removed? Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. signature.asc Description: Digital signature
Bug#390184: [Pkg-sysvinit-devel] Bug#390184: initscripts: please limit the size of /lib/init/rw
[Mario Holbe] I personally think that something around 100k should suffice, but if you like to have it somehow dynamic, I attached a small sample patch which limits the size to one tenth of available memory. Thank you for the patch. If we want dosemu and user-mode-linux to stop using /dev/shm/ to store their mmaped files, and instead use /lib/init/rw/ or similar, the size will have to be a lot higher than 100k. One idea I am considering is to make /dev/shm/ a symlink or bind-mount to a subdirectory /lib/init/rw/shm/, and thus only have one tmpfs file system by default. I also consider modifying the RANLOCK and RANRUN code to behave similarly, either symlink or bind-mount to /lib/init/rw/. I moved the section which mounts /lib/init/rw down a bit to access /proc/meminfo. I decided to mount it before /proc/, because we plan to modify mount to use a file in /lib/init/rw/ instead of /etc/mtab to get rid of a lot of complexity handling /etc/mtab. I'm not sure if we want to move it after /proc/ because of this. Friendly, -- Petter Reinholdtsen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#390184: [Pkg-sysvinit-devel] Bug#390184: initscripts: please limit the size of /lib/init/rw
On Fri, Sep 29, 2006 at 07:39:26PM +0200, Petter Reinholdtsen wrote: One idea I am considering is to make /dev/shm/ a symlink or bind-mount to a subdirectory /lib/init/rw/shm/, and thus only have one tmpfs file Ha! I did think about something similar, too! :) In fact, I did think about making /dev/shm a sub-directory bind-mount of /tmp, however, making /dev/shm a sub-directory bind-mount of /lib/init/rw would also be nice. If you do so, please think about also creating a sub-directory as mount-point for /tmp :) Mario -- [mod_nessus for iauth] delta scanning your system...found depreciated OS...found hole...installing new OS...please reboot and reconnect now signature.asc Description: Digital signature
Bug#390184: [Pkg-sysvinit-devel] Bug#390184: initscripts: please limit the size of /lib/init/rw
On Fri, Sep 29, 2006 at 07:39:26PM +0200, Petter Reinholdtsen wrote: One idea I am considering is to make /dev/shm/ a symlink or bind-mount to a subdirectory /lib/init/rw/shm/, and thus only have one tmpfs file Oh, I forgot... If you do so, please remind that bind-mounts inherit mount-options from their original mounts. You cannot apply different mount-options for them. This should be no problem currently, since you just mounted /lib/init/rw nosuid only. Btw... I assume you could safely add nodev to it, btw. However, if you consider to share it with /tmp you definitely need to avoid noexec due to dpkg-preconfigure :) Mario -- There are 10 types of people in the world: Those who understand binary, and those who don't... signature.asc Description: Digital signature