aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2009-01-07 21:07:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:04 -0500
commitbced0520fe462bb94021dcabd32e99630c171be2 (patch)
tree6fa234f4a25bc8231742aea13e7cc2664b0a69a6 /mm/shmem.c
parent7a81b88cb53e335ff7d019e6398c95792c817d93 (diff)
memcg: fix gfp_mask of callers of charge
Fix misuse of gfp_kernel. Now, most of callers of mem_cgroup_charge_xxx functions uses GFP_KERNEL. I think that this is from the fact that page_cgroup *was* dynamically allocated. But now, we allocate all page_cgroup at boot. And mem_cgroup_try_to_free_pages() reclaim memory from GFP_HIGHUSER_MOVABLE + specified GFP_RECLAIM_MASK. * This is because we just want to reduce memory usage. "Where we should reclaim from ?" is not a problem in memcg. This patch modifies gfp masks to be GFP_HIGUSER_MOVABLE if possible. Note: This patch is not for fixing behavior but for showing sane information in source code. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 5941f980136..bd9b4ea307b 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -928,8 +928,8 @@ found:
928 error = 1; 928 error = 1;
929 if (!inode) 929 if (!inode)
930 goto out; 930 goto out;
931 /* Precharge page using GFP_KERNEL while we can wait */ 931 /* Charge page using GFP_HIGHUSER_MOVABLE while we can wait */
932 error = mem_cgroup_cache_charge(page, current->mm, GFP_KERNEL); 932 error = mem_cgroup_cache_charge(page, current->mm, GFP_HIGHUSER_MOVABLE);
933 if (error) 933 if (error)
934 goto out; 934 goto out;
935 error = radix_tree_preload(GFP_KERNEL); 935 error = radix_tree_preload(GFP_KERNEL);
@@ -1379,7 +1379,7 @@ repeat:
1379 1379
1380 /* Precharge page while we can wait, compensate after */ 1380 /* Precharge page while we can wait, compensate after */
1381 error = mem_cgroup_cache_charge(filepage, current->mm, 1381 error = mem_cgroup_cache_charge(filepage, current->mm,
1382 gfp & ~__GFP_HIGHMEM); 1382 GFP_HIGHUSER_MOVABLE);
1383 if (error) { 1383 if (error) {
1384 page_cache_release(filepage); 1384 page_cache_release(filepage);
1385 shmem_unacct_blocks(info->flags, 1); 1385 shmem_unacct_blocks(info->flags, 1);