Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 1995 07:55:13 -0700 (PDT)
From:      John Dyson <dyson>
To:        tinguely@plains.nodak.edu (Mark Tinguely)
Cc:        gurney_j@efn.org, hackers@freebsd.org
Subject:   Re: problems with programs being swaped out!!
Message-ID:  <199508311456.HAA07389@freefall.FreeBSD.org>
In-Reply-To: <199508311424.JAA28099@plains.nodak.edu> from "Mark Tinguely" at Aug 31, 95 09:24:22 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> >  right now I am having a regular problem with programs getting swapped out 
> >  but never getting back in... right now Netscape just died on me wand it 
> >  has the ps flags of: IW  Right now netscape just stop responding...  I 
> >  have a 486/33DX (running at 40mhz), w/ 8megs ram and swap:
> 
> in pre 4.4 days, BSD VM copied the entire text to backstore and user and
         ^^^^ Net/2
> sbrk pages were shoved into backstore when needed and they stayed there
> until the program ended.
> 
> since 386BSD days, it is normal operation for single page put into backstored
> or a entire process is swap put into backstore, to remains in backstore until
> the process died. The backstore acts like a cache.
> 
> Back in late 386BSD or early FreeBSD, I modified the VM code to do exactly
> like you wished happened, when a page(s) is brought back into RAM, the page
> is removed from backstore. I kept counters to count the pages in/out of
> backstore and the number of pages that were/were not modified before being
> put on backstore after being brought back in. By the way, re-writes to
> backstore without modification of the page was rare, so my changes did
> not introduce much new overhead. At the time the disks and RAM were
> smaller, swap backstore space was a premium. Logic says that a swapping machine
> most like will not choose the same file to push out in low memory conditions
> and this could lead to then common "full VM lockup error". My change did
> help significantly my lowly 25 MHz 386 with 8 MB RAM and 80 MB running X.
> 
There are some mods to swap pager (during the rewrite) that causes to system
to free swap space as pages are are paged in (only when the system is low
on swap.)

> Just after my changes, the VM was rewritten. I am under the impression
> (****** DISCLAIMER -- I HAVE NOT HAD TIME TO STUDY THE VM FOR SOME TIME,
> I COULD BE MISTAKEN *****) that larger chunks of backstore are read into the
> system to improve speed. At times, some pages are discarded which is okay 
> because they are on the backstore.
> 
> I would like to take the time to restudy the VM, count the cost of putting
> that code back in the VM, and also put look at a features for a laptop to
> automatically power down without losing currently running processes.
> 
Probably the best approach is for the system to free-up swap space for
pages that are resident when the system is low on memory.  I have been thinking
about this actually.  There are some more substantial improvements going in
soon, and I'll be glad to add this clean-up operation (note that I think
that it should happen only in low-VM situations.)  My initial impression
is that it is not optimal to free the pages from swap all of the
time when paging pages in (esp for typically configured non-vm starved
systems.)

The approach that I have been planning on taking is for the pageout
daemon to perform the clean-up (perhaps calling a swap_pager entry point.)
Note that the swap_pager and vnode_pagers are undergoing major
renovation -- we are going to have the VOP_GETPAGES, VOP_PUTPAGES entry
points, and I plan for the swap_pager to use them also (most of the
time talking to the specfs entry points, but it will also be able to
use ufs or ext2fs entry points :-).)

John
dyson@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508311456.HAA07389>