Re: Why active list and inactive list?

Christoph Lameter
2007-01-23T03:53:36Z

On Tue, 23 Jan 2007, Balbir Singh wrote:

> Yes, good point, I see what you mean in terms of impact. But the trade
> off could come from shrink_active_list() which does
>
> list_del(&page->lru)
> if (!reclaim_mapped && other_conditions)
> list_add(&page->lru, &l_active);
> ...
>
> In the case mentioned above, we would triple the cachlines when an area
> is mapped/unmapped (which might be acceptable since it is a state change
> for the page ;) ). In the trade-off I mentioned, it would happen
> everytime reclaim is invoked and it has nothing to do with a page changing
> state.
>
> Did I miss something?

We do the list_del/list_add right now in reclaim while moving pages
between active and inactive lists. However, reclaim is not run until the
systems is under memory pressure. Reclaim is run rarely and then lots of
these movements are occurring. At that point is it likely that the
cachelines are already available since the page structs had to be touched
for earlier movements.