diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2009-09-21 20:01:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:29 -0400 |
commit | a731286de62294b63d8ceb3c5914ac52cc17e690 (patch) | |
tree | c321e14500ec264e37fd103ffa71c7b133088010 /mm/vmscan.c | |
parent | b35ea17b7bbf5dea35faa0de11030acc620c3197 (diff) |
mm: vmstat: add isolate pages
If the system is running a heavy load of processes then concurrent reclaim
can isolate a large number of pages from the LRU. /proc/vmstat and the
output generated for an OOM do not show how many pages were isolated.
This has been observed during process fork bomb testing (mstctl11 in LTP).
This patch shows the information about isolated pages.
Reproduced via:
-----------------------
% ./hackbench 140 process 1000
=> OOM occur
active_anon:146 inactive_anon:0 isolated_anon:49245
active_file:79 inactive_file:18 isolated_file:113
unevictable:0 dirty:0 writeback:0 unstable:0 buffer:39
free:370 slab_reclaimable:309 slab_unreclaimable:5492
mapped:53 shmem:15 pagetables:28140 bounce:0
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index d86a91f8c16b..75c29974e878 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1072,6 +1072,8 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, | |||
1072 | unsigned long nr_active; | 1072 | unsigned long nr_active; |
1073 | unsigned int count[NR_LRU_LISTS] = { 0, }; | 1073 | unsigned int count[NR_LRU_LISTS] = { 0, }; |
1074 | int mode = lumpy_reclaim ? ISOLATE_BOTH : ISOLATE_INACTIVE; | 1074 | int mode = lumpy_reclaim ? ISOLATE_BOTH : ISOLATE_INACTIVE; |
1075 | unsigned long nr_anon; | ||
1076 | unsigned long nr_file; | ||
1075 | 1077 | ||
1076 | nr_taken = sc->isolate_pages(sc->swap_cluster_max, | 1078 | nr_taken = sc->isolate_pages(sc->swap_cluster_max, |
1077 | &page_list, &nr_scan, sc->order, mode, | 1079 | &page_list, &nr_scan, sc->order, mode, |
@@ -1102,6 +1104,10 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, | |||
1102 | __mod_zone_page_state(zone, NR_INACTIVE_ANON, | 1104 | __mod_zone_page_state(zone, NR_INACTIVE_ANON, |
1103 | -count[LRU_INACTIVE_ANON]); | 1105 | -count[LRU_INACTIVE_ANON]); |
1104 | 1106 | ||
1107 | nr_anon = count[LRU_ACTIVE_ANON] + count[LRU_INACTIVE_ANON]; | ||
1108 | nr_file = count[LRU_ACTIVE_FILE] + count[LRU_INACTIVE_FILE]; | ||
1109 | __mod_zone_page_state(zone, NR_ISOLATED_ANON, nr_anon); | ||
1110 | __mod_zone_page_state(zone, NR_ISOLATED_FILE, nr_file); | ||
1105 | 1111 | ||
1106 | reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON]; | 1112 | reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON]; |
1107 | reclaim_stat->recent_scanned[0] += count[LRU_ACTIVE_ANON]; | 1113 | reclaim_stat->recent_scanned[0] += count[LRU_ACTIVE_ANON]; |
@@ -1169,6 +1175,9 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, | |||
1169 | spin_lock_irq(&zone->lru_lock); | 1175 | spin_lock_irq(&zone->lru_lock); |
1170 | } | 1176 | } |
1171 | } | 1177 | } |
1178 | __mod_zone_page_state(zone, NR_ISOLATED_ANON, -nr_anon); | ||
1179 | __mod_zone_page_state(zone, NR_ISOLATED_FILE, -nr_file); | ||
1180 | |||
1172 | } while (nr_scanned < max_scan); | 1181 | } while (nr_scanned < max_scan); |
1173 | 1182 | ||
1174 | done: | 1183 | done: |
@@ -1279,6 +1288,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1279 | __mod_zone_page_state(zone, NR_ACTIVE_FILE, -nr_taken); | 1288 | __mod_zone_page_state(zone, NR_ACTIVE_FILE, -nr_taken); |
1280 | else | 1289 | else |
1281 | __mod_zone_page_state(zone, NR_ACTIVE_ANON, -nr_taken); | 1290 | __mod_zone_page_state(zone, NR_ACTIVE_ANON, -nr_taken); |
1291 | __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, nr_taken); | ||
1282 | spin_unlock_irq(&zone->lru_lock); | 1292 | spin_unlock_irq(&zone->lru_lock); |
1283 | 1293 | ||
1284 | while (!list_empty(&l_hold)) { | 1294 | while (!list_empty(&l_hold)) { |
@@ -1329,7 +1339,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1329 | LRU_ACTIVE + file * LRU_FILE); | 1339 | LRU_ACTIVE + file * LRU_FILE); |
1330 | move_active_pages_to_lru(zone, &l_inactive, | 1340 | move_active_pages_to_lru(zone, &l_inactive, |
1331 | LRU_BASE + file * LRU_FILE); | 1341 | LRU_BASE + file * LRU_FILE); |
1332 | 1342 | __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken); | |
1333 | spin_unlock_irq(&zone->lru_lock); | 1343 | spin_unlock_irq(&zone->lru_lock); |
1334 | } | 1344 | } |
1335 | 1345 | ||