Sticky bit -- To set or not to set.

Malaclypse the Elder dwc at homxc.UUCP
Wed Apr 27 01:17:00 AEST 1988


In article <1768 at cuuxb.ATT.COM>, dlm at cuuxb.ATT.COM (Dennis L. Mumaugh) writes:
> #	The sticky bit should be set *only* for very heavily used programs
> #that are not in continuous use. It is intended to help reduce the startup
> #overhead of major system utilities, like vi, especially moderately large ones.
> #WARNING: setting the sticky bit uses up swap space and RAM, so make sure you
> #have enough of both to handle ALL sticky programs plus any normal user program
> #mix that you can foresee. Thus on most systems only vi/ex and perhaps the
> #shells need or should have the sticky bit set. On some turnkey systems it
> #might be useful to make the main user application sticky as well.

behrohk samadi has developed an expert system for unix administration
called TUNEX.  one of the things it does is look at process accounting
data to determine which programs are candidates for sticky bitting.  
she presented TUNEX at the 1987 winter usenix in washington and a paper
is in the conference proceedings.  it is available as part of the
at&t toolchest.
> 
> The sticky bit is  ONLY  meaningful  for  swapping  machines.  On
> demand paging it doesn't make much sense.  It was used because the
> "text" for a program was scattered on the disk (as  a  file).  It
> was fully loaded into core (no partial loads on  swapping).  The
> text would then (we hope) be copied onto the  swap  disk  as  one
> contiguous image.  Hence loading it from swap was much faster (if
> the disk driver and hardware allowed a single transfer).
> 
> With demand paging the disk file is page aligned  and  the  pages
> are swapped in from the file system as required and not placed on
> the swap/page device unless modified.  Hence the sticky bit isn't
> of much use.
> 
while these comments are generally true for current paging versions
of System V on 3B2s, the value of sticky bits are implementation
dependent.  one way to look at it is that the swap area is a contiguous
"filesystem" for kernel use.  so if there is a difference between
the performance of doing I/O from the swap area and the standard
unix filesystem, then the sticky bit is available to use as a means
of specifying which programs might benefit from some overhead to
save on I/O (hint hint).

on current paging versions on the 3B2, for example, the filesystem
block size is typically 1K while the page size is 2K.  thus if a
program were sticky bitted and stayed on the swap device even though
not contiguous, it would still benefit from having to do 1 I/O from
the swap device per page fault instead of 2 I/Os from the filesystem.
unfortunately, i'm not sure whether the recent releases still have
a quirk in them such that this only works for sticky bitted programs
with magic number 410 (default is 413).

danny chen
homxc!dwc



More information about the Comp.unix.wizards mailing list