[PATCH] mmtom: Prevent shrinking of active anon lru list in case ofno swap space V4

From: Minchan Kim
Date: Thu May 14 2009 - 21:38:35 EST


Hi, Adnrew.

Please, drop my previous version and merge this.
This versoin can enhance code size and performance by GCC code optimization.
If you wnat to know it detail, please, reference to Johannes Weiner's saying in V3 thread.

Changelog since V4
o Make to check nr_swap_pages at first. - by Hannes's advise
o It can reduce text size and increase performance a litte bit by GCC code optimization.

Changelog since V3
o Remove can_reclaim_anon.
o Add nr_swap_page > 0 in only shrink_zone - By Rik's advise.
o Change patch description.

Changelog since V2
o Add new function - can_reclaim_anon : it tests anon_list can be reclaim.

Changelog since V1
o Use nr_swap_pages <= 0 in shrink_active_list to prevent scanning of active anon list.

Now shrink_zone can deactivate active anon pages even if we don't have a swap device.
Many embedded products don't have a swap device. So the deactivation of anon pages is unnecessary.

This patch prevents unnecessary deactivation of anon lru pages.
But, it doesn't prevent aging of anon pages to swap out.

Thanks for good review. Rik,Kosaki and Hannes.