Re: [PATCH] prevent to reclaim anon page of lumpy reclaim for no swap space

From: Minchan Kim
Date: Thu Jun 25 2009 - 10:36:50 EST


On Thu, Juna 25, 2009 at 11:09 PM, Rik van Riel<riel@xxxxxxxxxx> wrote:
> Minchan Kim wrote:
>>
>> This patch prevent to reclaim anon page in case of no swap space.
>> VM already prevent to reclaim anon page in various place.
>> But it doesnt't prevent it for lumpy reclaim.
>>
>> It shuffles lru list unnecessary so that it is pointless.
>> Signed-off-by: Minchan Kim <minchan.kim@xxxxxxxxx>
>> ---
>> Âmm/vmscan.c | Â Â6 ++++++
>> Â1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 026f452..fb401fe 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -830,7 +830,13 @@ int __isolate_lru_page(struct page *page, int mode,
>> int file)
>> Â Â Â Â * When this function is being called for lumpy reclaim, we
>> Â Â Â Â * initially look into all LRU pages, active, inactive and
>> Â Â Â Â * unevictable; only give shrink_page_list evictable pages.
>> +
>> + Â Â Â Â* If we don't have enough swap space, reclaiming of anon page
>> + Â Â Â Â* is pointless.
>> Â Â Â Â */
>> + Â Â Â if (nr_swap_pages <= 0 && PageAnon(page))
>> + Â Â Â Â Â Â Â return ret;
>> +
>
> Should that be something like this:
>
> Â Â Â Âif (nr_swap_pages <= 0 && (PageAnon(page) && !PageSwapCache(page)))
>
> We can still reclaim anonymous pages that already have
> a swap slot assigned to them.

Yes. I missed that.
Thanks for careful review. Rik. :)

>
> --
> All rights reversed.
>



--
Kinds regards,
Minchan Kim
--
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/