1 --- linux-2.6.28/mm/vmscan.c 2008-12-25 00:26:37.000000000 +0100
2 +++ linux-2.6.28.new/mm/vmscan.c 2011-06-02 13:51:01.615325087 +0200
3 @@ -1342,13 +1342,6 @@ static void get_scan_ratio(struct zone *
4 zone_page_state(zone, NR_INACTIVE_FILE);
5 free = zone_page_state(zone, NR_FREE_PAGES);
7 - /* If we have no swap space, do not bother scanning anon pages. */
8 - if (nr_swap_pages <= 0) {
14 /* If we have very few page cache pages, force-scan anon pages. */
15 if (unlikely(file + free <= zone->pages_high)) {
17 @@ -1416,8 +1409,16 @@ static unsigned long shrink_zone(int pri
18 unsigned long nr_reclaimed = 0;
19 unsigned long percent[2]; /* anon @ 0; file @ 1 */
24 - get_scan_ratio(zone, sc, percent);
25 + /* If we have no swap space, do not bother scanning anon pages. */
26 + if (!sc->may_swap || (nr_swap_pages <= 0)) {
31 + get_scan_ratio(zone, sc, percent);
33 for_each_evictable_lru(l) {
34 if (scan_global_lru(sc)) {
35 @@ -1425,8 +1426,12 @@ static unsigned long shrink_zone(int pri
38 scan = zone_page_state(zone, NR_LRU_BASE + l);
41 + if (priority || noswap) {
42 + tmp_priority = priority;
44 + if (file && priority > 0)
45 + tmp_priority = DEF_PRIORITY;
46 + scan >>= tmp_priority;
47 scan = (scan * percent[file]) / 100;
49 zone->lru[l].nr_scan += scan;