diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 2fdd1380bf0a..59ac95a64508 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -26,6 +26,16 @@ struct page; | |||
26 | struct mm_struct; | 26 | struct mm_struct; |
27 | 27 | ||
28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
29 | /* | ||
30 | * All "charge" functions with gfp_mask should use GFP_KERNEL or | ||
31 | * (gfp_mask & GFP_RECLAIM_MASK). In current implementatin, memcg doesn't | ||
32 | * alloc memory but reclaims memory from all available zones. So, "where I want | ||
33 | * memory from" bits of gfp_mask has no meaning. So any bits of that field is | ||
34 | * available but adding a rule is better. charge functions' gfp_mask should | ||
35 | * be set to GFP_KERNEL or gfp_mask & GFP_RECLAIM_MASK for avoiding ambiguous | ||
36 | * codes. | ||
37 | * (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.) | ||
38 | */ | ||
29 | 39 | ||
30 | extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, | 40 | extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, |
31 | gfp_t gfp_mask); | 41 | gfp_t gfp_mask); |