Messages in this thread | | | Date | Tue, 24 Nov 1998 12:34:10 +0000 | From | Neil Conway <> | Subject | Re: Patch: vm_enough_memory() (2.1.129) |
| |
Rik van Riel wrote: > > On Mon, 23 Nov 1998, Neil Conway wrote: > > > Here's my stab at a fix to the vm_enough_memory() function. This > > currently underestimates available memory by large amounts (has been > > wrong by over 200MB on my 512MB RAM + 512MB Swap machine). > > Excellent fix, I hope Linus will put it into 2.1.130/2.2.0 > (depending on his mood/confidence/whatever). > > > It *tries* to do it the right way, but I'm no expert. In fact, it > > was sufficiently easy to fix that I have a lingering suspicion that > > I've missed the point. > > The point is that we've all been to lazy to fix it, even > though we knew it should have been fixed. I take it you > missed that one :)
Actually, there's still what could be regarded as a bug and I don't know how to fix it cos I don't understand what's going on...
In my original (last week) large post to the list whining about the problem (this post was universally ignored, boohoo) I noted not only the problem that I have now fixed, but another, which I took to be a bug at the time but now believe to be deliberate kernel behaviour: after a session of major swapping, the machine had NO major memory-using programs running (nothing at all bar what's there at boot) but still had this output from free:
total used free shared buffers cached Mem: 516400 168752 347648 1540 5240 157392 -/+ buffers/cache: 6120 510280 Swap: 522992 160368 362624
If I interpret this correctly, the cache (of roughly 160megs) and the swap (of roughly the same) are closely linked. Is this something to do with "swap-cache" ?? I don't know what swap-cache is.
However, this will harm my "free-memory" algorithm. In fact, in the above case, the memory isn't REALLY used, and so it should be regarded as available, but my algorithm will regard it as being used since the swap IS used (it'll ignore the cache though). So in this case, a tiny bit of swapping seems to cause the machine to dump all of the cache and swap, but until then, large programs are unable to use that 160megs.
Suggestions ?
Neil
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |