diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 13 | ||||
-rw-r--r-- | mm/vmscan.c | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6ceb6f2dbac2..e2fa20dadf40 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -649,6 +649,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
649 | int zid = zone_idx(z); | 649 | int zid = zone_idx(z); |
650 | struct mem_cgroup_per_zone *mz; | 650 | struct mem_cgroup_per_zone *mz; |
651 | int lru = LRU_FILE * !!file + !!active; | 651 | int lru = LRU_FILE * !!file + !!active; |
652 | int ret; | ||
652 | 653 | ||
653 | BUG_ON(!mem_cont); | 654 | BUG_ON(!mem_cont); |
654 | mz = mem_cgroup_zoneinfo(mem_cont, nid, zid); | 655 | mz = mem_cgroup_zoneinfo(mem_cont, nid, zid); |
@@ -666,9 +667,19 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
666 | continue; | 667 | continue; |
667 | 668 | ||
668 | scan++; | 669 | scan++; |
669 | if (__isolate_lru_page(page, mode, file) == 0) { | 670 | ret = __isolate_lru_page(page, mode, file); |
671 | switch (ret) { | ||
672 | case 0: | ||
670 | list_move(&page->lru, dst); | 673 | list_move(&page->lru, dst); |
674 | mem_cgroup_del_lru(page); | ||
671 | nr_taken++; | 675 | nr_taken++; |
676 | break; | ||
677 | case -EBUSY: | ||
678 | /* we don't affect global LRU but rotate in our LRU */ | ||
679 | mem_cgroup_rotate_lru_list(page, page_lru(page)); | ||
680 | break; | ||
681 | default: | ||
682 | break; | ||
672 | } | 683 | } |
673 | } | 684 | } |
674 | 685 | ||
diff --git a/mm/vmscan.c b/mm/vmscan.c index 4139aa52b941..e8fa2d9eb212 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -837,7 +837,6 @@ int __isolate_lru_page(struct page *page, int mode, int file) | |||
837 | */ | 837 | */ |
838 | ClearPageLRU(page); | 838 | ClearPageLRU(page); |
839 | ret = 0; | 839 | ret = 0; |
840 | mem_cgroup_del_lru(page); | ||
841 | } | 840 | } |
842 | 841 | ||
843 | return ret; | 842 | return ret; |
@@ -885,12 +884,14 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, | |||
885 | switch (__isolate_lru_page(page, mode, file)) { | 884 | switch (__isolate_lru_page(page, mode, file)) { |
886 | case 0: | 885 | case 0: |
887 | list_move(&page->lru, dst); | 886 | list_move(&page->lru, dst); |
887 | mem_cgroup_del_lru(page); | ||
888 | nr_taken++; | 888 | nr_taken++; |
889 | break; | 889 | break; |
890 | 890 | ||
891 | case -EBUSY: | 891 | case -EBUSY: |
892 | /* else it is being freed elsewhere */ | 892 | /* else it is being freed elsewhere */ |
893 | list_move(&page->lru, src); | 893 | list_move(&page->lru, src); |
894 | mem_cgroup_rotate_lru_list(page, page_lru(page)); | ||
894 | continue; | 895 | continue; |
895 | 896 | ||
896 | default: | 897 | default: |
@@ -931,6 +932,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, | |||
931 | continue; | 932 | continue; |
932 | if (__isolate_lru_page(cursor_page, mode, file) == 0) { | 933 | if (__isolate_lru_page(cursor_page, mode, file) == 0) { |
933 | list_move(&cursor_page->lru, dst); | 934 | list_move(&cursor_page->lru, dst); |
935 | mem_cgroup_del_lru(page); | ||
934 | nr_taken++; | 936 | nr_taken++; |
935 | scan++; | 937 | scan++; |
936 | } | 938 | } |