diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 322625f551c2..fb62b4335fa9 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -773,10 +773,10 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
773 | * but there might be left over accounting, even after children | 773 | * but there might be left over accounting, even after children |
774 | * have left. | 774 | * have left. |
775 | */ | 775 | */ |
776 | ret = try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap, | 776 | ret += try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap, |
777 | get_swappiness(root_mem)); | 777 | get_swappiness(root_mem)); |
778 | if (mem_cgroup_check_under_limit(root_mem)) | 778 | if (mem_cgroup_check_under_limit(root_mem)) |
779 | return 0; | 779 | return 1; /* indicate reclaim has succeeded */ |
780 | if (!root_mem->use_hierarchy) | 780 | if (!root_mem->use_hierarchy) |
781 | return ret; | 781 | return ret; |
782 | 782 | ||
@@ -787,10 +787,10 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
787 | next_mem = mem_cgroup_get_next_node(root_mem); | 787 | next_mem = mem_cgroup_get_next_node(root_mem); |
788 | continue; | 788 | continue; |
789 | } | 789 | } |
790 | ret = try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap, | 790 | ret += try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap, |
791 | get_swappiness(next_mem)); | 791 | get_swappiness(next_mem)); |
792 | if (mem_cgroup_check_under_limit(root_mem)) | 792 | if (mem_cgroup_check_under_limit(root_mem)) |
793 | return 0; | 793 | return 1; /* indicate reclaim has succeeded */ |
794 | next_mem = mem_cgroup_get_next_node(root_mem); | 794 | next_mem = mem_cgroup_get_next_node(root_mem); |
795 | } | 795 | } |
796 | return ret; | 796 | return ret; |
@@ -875,6 +875,8 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, | |||
875 | 875 | ||
876 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, gfp_mask, | 876 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, gfp_mask, |
877 | noswap); | 877 | noswap); |
878 | if (ret) | ||
879 | continue; | ||
878 | 880 | ||
879 | /* | 881 | /* |
880 | * try_to_free_mem_cgroup_pages() might not give us a full | 882 | * try_to_free_mem_cgroup_pages() might not give us a full |