login
Header Space

 
 

Re: .97 (new buffer allocation code)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, August 5, 1992 - 8:03 am

In article <1992Aug5.102706.15668@colorado.edu> drew@ophelia.cs.colorado.edu (Drew Eckhardt) writes:

The accessed bit will be used in the soon-to-be-made (I didn't get them
together yesterday, but I'll try again today) first patch to 0.97. It's
very practical, and didn't need any additional state information. While
the current routine isn't a real LRU (Least Recently Used) which needs
some actual calculations, it's NRU (Not Recently Used) which is a simple
approximation that can do with just the one bit that is already provided
by the hardware.

A closer approximation to LRU would be some aging mechanism (the 386
page tables even have room for a 3-bit wide aging or somthing like that
in the unused bits), and it might be worth implementing eventually.


This is similar to what the 0.97+patch1 algorithm does - it's simple,
and while it's not perfect it works relatively well.  Or at least that's
the early indications from my tests.  I won't be able to do exhaustive
tuning of the algorithms, so the patch1 algorithm might not be perfect. 
We'll see. 


It's a bit more work to actually go through the pages and take this into
account, so I currently don't. But you are right: this is how it should
(and will) be done.


Actually, it's not a very time-critical check: it's done by the idle
task anyway (which is the reason I originally made task[0] special: it
just hasn't been used up till now).  That way the machine does something
useful even when waiting for disk accesses etc.  In patch1 the algorithm
just searches for non-accessed pages so that the system doesn't have to
do those calculations every time it wants to swap something out.  It
should be relatively easy to enhance to do aging and check on the same
page being used by several different processes. 

                Linus
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: .97 (new buffer allocation code), Linus Benedict Torvalds, (Wed Aug 5, 8:03 am)
speck-geostationary