Bug#390184: [Pkg-sysvinit-devel] Bug#390184: initscripts: please limit the size of /lib/init/rw

Roger Leigh rleigh at whinlatter.ukfsn.org
Sun Nov 26 11:27:35 CET 2006


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20061126/e7ac5ca3/attachment.pgp


More information about the Pkg-sysvinit-devel mailing list