Re: broken VM in 2.4.10-pre9

Daniel Phillips
2001-09-17T00:34:25Z

On September 16, 2001 09:43 pm, Linus Torvalds wrote:
> The fact that the "use-once" logic didn't kick in is the problem. It's
> hard to tell _why_ it didn't kick in, possibly because the MP3 player
> read small chunks of the pages (touching them multiple times).

Can we confirm that the mp3 player is making subpage accesses? (strace)

The 'partially read/written' state isn't handled properly now. The
transition to the 'used-once' state should only occur if the transfer ends at
the exact end of the page. Right now it always takes place after the *first*
transfer on the page which is correct only for full-page transfers.

It's still best to start all pages unreferenced, because otherwise we don't
have a means of distinguishing between the first and subsequent page cache
lookups. The check_used_once logic should set the page referenced if the IO
transfer ends in the interior of the page or unreferenced if it ends at the
end of the page.

This straightforward to fix, I'll have a tested patch by Tuesday if nobody
beats me to it. I don't think this is the whole problem though, it's just
exposing a balancing problem. Even if I did go and randomly access a huge
file so that all cache pages have high age (the effect we're simulating by
accident here) I still shouldn't be able to drive all my swap pages out of
memory.

--
Daniel