aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index d58305e8a484..f92fea94d037 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1315,17 +1315,14 @@ repeat:
1315 shmem_swp_unmap(entry); 1315 shmem_swp_unmap(entry);
1316 spin_unlock(&info->lock); 1316 spin_unlock(&info->lock);
1317 unlock_page(swappage); 1317 unlock_page(swappage);
1318 page_cache_release(swappage);
1318 if (error == -ENOMEM) { 1319 if (error == -ENOMEM) {
1319 /* allow reclaim from this memory cgroup */ 1320 /* allow reclaim from this memory cgroup */
1320 error = mem_cgroup_cache_charge(swappage, 1321 error = mem_cgroup_shrink_usage(current->mm,
1321 current->mm, gfp & ~__GFP_HIGHMEM); 1322 gfp);
1322 if (error) { 1323 if (error)
1323 page_cache_release(swappage);
1324 goto failed; 1324 goto failed;
1325 }
1326 mem_cgroup_uncharge_cache_page(swappage);
1327 } 1325 }
1328 page_cache_release(swappage);
1329 goto repeat; 1326 goto repeat;
1330 } 1327 }
1331 } else if (sgp == SGP_READ && !filepage) { 1328 } else if (sgp == SGP_READ && !filepage) {