*BSD News Article 47851


Return to BSD News archive

Xref: sserve news.software.nntp:14762 comp.unix.bsd.freebsd.misc:3956 comp.os.linux.advocacy:14789
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!gatech!gt-news!cc.gatech.edu!cc.gatech.edu!byron
From: byron@cc.gatech.edu (Byron A Jeff)
Newsgroups: news.software.nntp,comp.unix.bsd.freebsd.misc,comp.os.linux.advocacy
Subject: Re: Sun/Solaris or Pentium/Linux for new server ?
Followup-To: comp.os.linux.development.system
Date: 3 Aug 1995 14:52:53 GMT
Organization: Georgia Institute of Technology - College of Computing
Lines: 48
Distribution: inet
Message-ID: <3vqns5$258@solaria.cc.gatech.edu>
References: <3vlpgk$rdk@graphite.comco.com> <3vpg3g$q35@shell2.best.com> <950803085819.AA29439@dojo>
NNTP-Posting-Host: gemini.cc.gatech.edu
NNTP-Posting-User: byron

I'm crossposting this one. Followups going to col.development.system

In article <950803085819.AA29439@dojo>, Mike O'Connor  <mjo@dojo.mi.org> wrote:
>In article <3vpg3g$q35@shell2.best.com>,
>Russell Carter <rcarter@best.com> wrote:
>2.  I love the Linux bug where it wants to allocate swap space and never 
>    free it up when it has enough memory such that it should damn near
>    never be swapping, particularly during an expire.  I 'blink' my
>    server on and off to free up some swap space every day, but watch
>    the number slowly crawl up even when "free" shows 18MB available 
>    and there are virtually no "idle" processes.  Fortunately, owing to
>    the kernel-of-the-month club, I reboot often enough, but I doubt I
>    could leave the box up for a month running news.

Can you explain in a bit more detail exactly what the problem is here? It
seems perfectly reasonable not to arbitrarily bring back unused stuff
from swap. Note that 'Unused' is the key word here. 

The whole point of swap is to keep main memory available for active processes.
If it's not being used it makes no sense to bring it back in.

Why not propose a policy for the swap to bring unused stuff back into main
memory then implement it? How would you choose what comes back in? How 
much to leave in swap? What to swap out once it gets busy again.

Let's see a free of your system so we can understand the magnitude of the
problem.

One thought: implement something like a swap buffer cache. When the system
is idle and not swapping and there's some very large ratio of free RAM pages
to swap pages, start prefilling the RAM with swap pages - BUT LEAVE COPIES
OF THOSE PAGES IN SWAP! Then the kernel could check to see if a page has
already been preswapped in while having the option to trash the page if
space becomes tight again without having to write said page out to swap
again, defeating the whole purpose. You get the best of both worlds in terms
of having previously swapped (and unused) pages already in RAM when you need
them and the ability to trash them without swapping them out again.

This would greatly improve performance on systems where swapped out pages
are used occasionally with periods of heavy swapping. Like a News server.

Thoughts?

BAJ
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff - PhD student operating in parallel - And Using Linux!
Georgia Tech, Atlanta GA 30332   Internet: byron@cc.gatech.edu