Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.
/ swapd Public archive

User space deamon for dynamically managing swap-space on Linux

License

Notifications You must be signed in to change notification settings

nwholloway/swapd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$Id: README,v 1.2 1995/05/21 20:26:57 alfie Exp alfie $

Every so often, there is an outcry about the Linux kernel, which goes
something like:

  o Shock!  Linux will grant requests for memory that it might not be
    able to satisfy, and how this is terrible.
  o All requests to sbrk() should be given real VM, so that no process
    has memory promises broken.
  o This is refuted by the fact that many system calls, eg fork(), can
    cause a need for more VM, as can even a function call (more stack).
  o This then prompts a call for the kernel to be able to dyncamically
    add swap space.
  o Finally, it is said that a user space daemon would be a more
    suitable place to do this.

This is where `swapd' comes in.  This is a program that will monitor
the amount of free VM available, and will dynamically add swap files
as needed.

I personally don't use this daemon, but there are people who have made
requests for a program of this sort.  So, this is for the people who
want it, or for the people that think they want it...

Swapd will allow free space in the filesystem to be used as swap when
needed by adding additional swap files as needed.

Swapd periodically monitors the amount of free swap available in
the system.  It tries to maintain the amount of swap using upper and
lower limits.  If the amount of free swap falls below the lower limit,
it will add an extra swapfile.  A swap file will be removed if it will
still leave the system with at least the upper limit available.

Since swapping from a file is less efficient than swapping from a
partition, this can be used to `top up' the swap when needed (but will
also work as the sole source of swap).

All of the parameters can either be changed at compile time, or at
run time from the command line.  The current defaults are arbitary --
if you find better settings, let me know.

The history of swapd is as follows:

  * The idea for swapd was originally conceived when I discovered that
    I had failed to compile xv due to being short of 1M of swap (after
    having 8+8Mb VM).

  * The original code was written in April 1993, but needed extra
    code (more parameters, signal handling, and parameter checking).
    Also it needed fsync() to hit the streets.

  * It sat on my disk until April 1994, where the discussion came up
    again, and I tidied up the code, and made it available on request.
    Only two people requested it, and no feedback was made.

  * In February 1995, the discussion appeared again, and the same offer
    was made.  This was taken up by more people, and feedback was
    received.

  * May 1995, since it was found useful, and the code seemed stable
    (and bugs fixed) it made it first public release.

  * April 1996, updated to deal with the new Linux /proc/meminfo format,
    and some small tweaks.

  * December 1996, fixed lack of handling for '-p' and added support
    for enabling real time scheduling (Andreas Kostyrka).

  * August 1998, changes for compilation under glibc.

Thanks to Tim Norman, Jim Nance, and David Groves (and possibly others
I have forgotten) for their encourangement and testing.

Thanks to Marc Merlin who submitted patches for using the new
/proc/meminfo layout, which shamed me into finishing off my own almost
completed patch.

More recently, thanks to Andreas Kostyrka for his submitted patches.  If
you are interested, he has an X11 configuration tool, ...

Since I have absolutely no idea who actually is using swapd, please tell
me if you are.

I am releasing swapd under the Gnu Public Licence (GPL).  See COPYING
for details.

    Nick Holloway
	<[email protected]>  http://www.alfie.demon.co.uk/

About

User space deamon for dynamically managing swap-space on Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages