diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2012-05-29 18:06:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:26 -0400 |
commit | 5dc35979e444b50d5551bdeb7a7abc5c69c875d0 (patch) | |
tree | 568fa3c4107ce1dd41385c98b4bbfc3dbff1fa8d | |
parent | 7f5e86c2ccc1480946d2c869d7f7d5278e828092 (diff) |
mm/vmscan: push lruvec pointer into isolate_lru_pages()
Move the mem_cgroup_zone_lruvec() call from isolate_lru_pages() into
shrink_[in]active_list(). Further patches push it to shrink_zone() step
by step.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/vmscan.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 77905eb3d8ad..b7d03d7b8f8e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1027,7 +1027,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode) | |||
1027 | * Appropriate locks must be held before calling this function. | 1027 | * Appropriate locks must be held before calling this function. |
1028 | * | 1028 | * |
1029 | * @nr_to_scan: The number of pages to look through on the list. | 1029 | * @nr_to_scan: The number of pages to look through on the list. |
1030 | * @mz: The mem_cgroup_zone to pull pages from. | 1030 | * @lruvec: The LRU vector to pull pages from. |
1031 | * @dst: The temp list to put pages on to. | 1031 | * @dst: The temp list to put pages on to. |
1032 | * @nr_scanned: The number of pages that were scanned. | 1032 | * @nr_scanned: The number of pages that were scanned. |
1033 | * @sc: The scan_control struct for this reclaim session | 1033 | * @sc: The scan_control struct for this reclaim session |
@@ -1037,17 +1037,15 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode) | |||
1037 | * returns how many pages were moved onto *@dst. | 1037 | * returns how many pages were moved onto *@dst. |
1038 | */ | 1038 | */ |
1039 | static unsigned long isolate_lru_pages(unsigned long nr_to_scan, | 1039 | static unsigned long isolate_lru_pages(unsigned long nr_to_scan, |
1040 | struct mem_cgroup_zone *mz, struct list_head *dst, | 1040 | struct lruvec *lruvec, struct list_head *dst, |
1041 | unsigned long *nr_scanned, struct scan_control *sc, | 1041 | unsigned long *nr_scanned, struct scan_control *sc, |
1042 | isolate_mode_t mode, enum lru_list lru) | 1042 | isolate_mode_t mode, enum lru_list lru) |
1043 | { | 1043 | { |
1044 | struct lruvec *lruvec; | ||
1045 | struct list_head *src; | 1044 | struct list_head *src; |
1046 | unsigned long nr_taken = 0; | 1045 | unsigned long nr_taken = 0; |
1047 | unsigned long scan; | 1046 | unsigned long scan; |
1048 | int file = is_file_lru(lru); | 1047 | int file = is_file_lru(lru); |
1049 | 1048 | ||
1050 | lruvec = mem_cgroup_zone_lruvec(mz->zone, mz->mem_cgroup); | ||
1051 | src = &lruvec->lists[lru]; | 1049 | src = &lruvec->lists[lru]; |
1052 | 1050 | ||
1053 | for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) { | 1051 | for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) { |
@@ -1274,6 +1272,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz, | |||
1274 | int file = is_file_lru(lru); | 1272 | int file = is_file_lru(lru); |
1275 | struct zone *zone = mz->zone; | 1273 | struct zone *zone = mz->zone; |
1276 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz); | 1274 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz); |
1275 | struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, mz->mem_cgroup); | ||
1277 | 1276 | ||
1278 | while (unlikely(too_many_isolated(zone, file, sc))) { | 1277 | while (unlikely(too_many_isolated(zone, file, sc))) { |
1279 | congestion_wait(BLK_RW_ASYNC, HZ/10); | 1278 | congestion_wait(BLK_RW_ASYNC, HZ/10); |
@@ -1292,8 +1291,8 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz, | |||
1292 | 1291 | ||
1293 | spin_lock_irq(&zone->lru_lock); | 1292 | spin_lock_irq(&zone->lru_lock); |
1294 | 1293 | ||
1295 | nr_taken = isolate_lru_pages(nr_to_scan, mz, &page_list, &nr_scanned, | 1294 | nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list, |
1296 | sc, isolate_mode, lru); | 1295 | &nr_scanned, sc, isolate_mode, lru); |
1297 | if (global_reclaim(sc)) { | 1296 | if (global_reclaim(sc)) { |
1298 | zone->pages_scanned += nr_scanned; | 1297 | zone->pages_scanned += nr_scanned; |
1299 | if (current_is_kswapd()) | 1298 | if (current_is_kswapd()) |
@@ -1444,6 +1443,7 @@ static void shrink_active_list(unsigned long nr_to_scan, | |||
1444 | isolate_mode_t isolate_mode = 0; | 1443 | isolate_mode_t isolate_mode = 0; |
1445 | int file = is_file_lru(lru); | 1444 | int file = is_file_lru(lru); |
1446 | struct zone *zone = mz->zone; | 1445 | struct zone *zone = mz->zone; |
1446 | struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, mz->mem_cgroup); | ||
1447 | 1447 | ||
1448 | lru_add_drain(); | 1448 | lru_add_drain(); |
1449 | 1449 | ||
@@ -1454,8 +1454,8 @@ static void shrink_active_list(unsigned long nr_to_scan, | |||
1454 | 1454 | ||
1455 | spin_lock_irq(&zone->lru_lock); | 1455 | spin_lock_irq(&zone->lru_lock); |
1456 | 1456 | ||
1457 | nr_taken = isolate_lru_pages(nr_to_scan, mz, &l_hold, &nr_scanned, sc, | 1457 | nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold, |
1458 | isolate_mode, lru); | 1458 | &nr_scanned, sc, isolate_mode, lru); |
1459 | if (global_reclaim(sc)) | 1459 | if (global_reclaim(sc)) |
1460 | zone->pages_scanned += nr_scanned; | 1460 | zone->pages_scanned += nr_scanned; |
1461 | 1461 | ||