]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: compaction: compact unevictable pages
authorMinchan Kim <minchan.kim@gmail.com>
Wed, 28 Sep 2011 00:50:18 +0000 (10:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 29 Sep 2011 06:08:08 +0000 (16:08 +1000)
commitca345a3e85b85ecde54965c30ffc2ebaf7fa8442
tree228b37e08b03a80e0a1b9fba96bba96a9ff10b42
parent5c3529e557a35edec19a1a5f4586169648f63b43
mm: compaction: compact unevictable pages

Presently compaction doesn't handle mlocked pages as it uses
__isolate_lru_page which doesn't consider unevicatable pages.  It is used
by just lumpy so it is pointless that it isolates unevictable pages.

But the situation has changed.  Compaction can handle unevictable pages
and it can help getting big contiguos pages in memory whcih is fragmented
by many pinned pages with mlock.

I tested this patch with following scenario.

1. A : allocate 80% anon pages in system
2. B : allocate 20% mlocked page in system
/* Maybe, mlocked pages are located in low pfn address */
3. kill A /* high pfn address are free */
4. echo 1 > /proc/sys/vm/compact_memory

old:

compact_blocks_moved 251
compact_pages_moved 44

new:

compact_blocks_moved 258
compact_pages_moved 412

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <jweiner@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <>
include/linux/mmzone.h
mm/compaction.c
mm/vmscan.c