Re: need help interpreting 'free' output.

Eric W. Biederman
2001-10-30T18:19:51Z

Linus Torvalds <torvalds@transmeta.com> writes:

> HOWEVER, _then_ I started wondering about whether the thing needs to be
> removed from the swap cache at all, and came to the conclusion that for
> the only case we really care about (and the only case where we _can_
> re-use the swap cache page), we don't actually need to remove it from the
> cache in the first place.

There is a second case, though you may be handling it differently now.
Typically the case is swap < RAM. But basically when we don't have
enough have enough swap pages it pays to drop pages from the swap
cache. So in as many places as we can figuring out how to drop
swap pages when the swap space is practically full is important.

The other alternative implementation is to create a logical backing
store for anonymous pages (so the don't need a presence in the page
table) and then we could just walk that backing store and free up swap
space on demand. Though if you can put anonymous pages in the page
cache now, a variation on that idea may be possible. We don't
want to remove the swap from pages that aren't in ram.

> Does anybody see why we have to remove it from the swap cache at all?

Not just for cow.

Eric