Re: Mem: and Swap: lines in /proc/meminfo

From: Rik van Riel
Date: Fri Dec 12 2003 - 07:01:19 EST


On Thu, 11 Dec 2003, Mike Fedyk wrote:

> > Note that the inactive clean pages count (more or less)
> > as free pages, too.
>
> But I should count it as "Inactive" right?

Yeah.

> So, if it's clean, then the page has already been zeroed out, and is
> ready to be used but just needs some flags updated? Or they contain
> possibly useful data, and just are not dirty?

The latter.

> So a page that is inactive, but not dirty will go directly in that
> list?

No, LRU ordering is preserved. The inactive clean list is just the
last stage before the page really gets freed.

> What can happen to Inact_clean pages besides being freed, and used on
> the free memory list?

The data that's still in the page could be referenced again, in which
case the page gets moved to the inactive dirty list and from there on
to the active list.

In effect, the inactive clean list is a "soft free" list, which means
we can keep a larger number of pages almost-free, without wasting
memory.


--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/