2007-12-30 07:33:33

by Minchan Kim

[permalink] [raw]
Subject: why do we call clear_active_flags in shrink_inactive_list ?

In 2.6.23's shrink_inactive_list function, why do we have to call
clear_active_flags after isolate_lru_pages call ?
IMHO, If it call isolate_lru_pages with "zone->inactive_list", It can
be sure that it is not PG_active. So I think It is unnecessary calling
clear_active_flags. Nonetheless, Why do we have to recheck PG_active
flags wich clear_active_flags.

If it is right, which case it happens that page is set to be PG_active ?

--
Thanks,
barrios


2008-01-02 23:53:43

by Rik van Riel

[permalink] [raw]
Subject: Re: why do we call clear_active_flags in shrink_inactive_list ?

On Sun, 30 Dec 2007 16:32:42 +0900
"minchan Kim" <[email protected]> wrote:

> In 2.6.23's shrink_inactive_list function, why do we have to call
> clear_active_flags after isolate_lru_pages call ?
> IMHO, If it call isolate_lru_pages with "zone->inactive_list", It can
> be sure that it is not PG_active.

If we call isolate_lru_pages with mode = ISOLATE_BOTH, then it
can return both active and inactive pages and the calling function
has to be able to deal with both kinds of pages.

ISOLATE_BOTH is used when the kernel is trying to defragment memory,
for larger physically contiguous allocations.

--
All rights reversed.