memcg: mm_match_cgroup not vm_match_cgroup

vm_match_cgroup is a perverse name for a macro to match mm with cgroup: rename
it mm_match_cgroup, matching mm_init_cgroup and mm_free_cgroup.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Hugh Dickins 2008-03-04 14:29:01 -08:00 committed by Linus Torvalds
parent acc4988bcf
commit bd845e38c7
3 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
gfp_t gfp_mask); gfp_t gfp_mask);
int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
#define vm_match_cgroup(mm, cgroup) \ #define mm_match_cgroup(mm, cgroup) \
((cgroup) == rcu_dereference((mm)->mem_cgroup)) ((cgroup) == rcu_dereference((mm)->mem_cgroup))
extern int mem_cgroup_prepare_migration(struct page *page); extern int mem_cgroup_prepare_migration(struct page *page);
@ -118,7 +118,7 @@ static inline int mem_cgroup_cache_charge(struct page *page,
return 0; return 0;
} }
static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
{ {
return 1; return 1;
} }

View file

@ -399,7 +399,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
int ret; int ret;
task_lock(task); task_lock(task);
ret = task->mm && vm_match_cgroup(task->mm, mem); ret = task->mm && mm_match_cgroup(task->mm, mem);
task_unlock(task); task_unlock(task);
return ret; return ret;
} }

View file

@ -321,7 +321,7 @@ static int page_referenced_anon(struct page *page,
* counting on behalf of references from different * counting on behalf of references from different
* cgroups * cgroups
*/ */
if (mem_cont && !vm_match_cgroup(vma->vm_mm, mem_cont)) if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
continue; continue;
referenced += page_referenced_one(page, vma, &mapcount); referenced += page_referenced_one(page, vma, &mapcount);
if (!mapcount) if (!mapcount)
@ -382,7 +382,7 @@ static int page_referenced_file(struct page *page,
* counting on behalf of references from different * counting on behalf of references from different
* cgroups * cgroups
*/ */
if (mem_cont && !vm_match_cgroup(vma->vm_mm, mem_cont)) if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
continue; continue;
if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE)) if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE))
== (VM_LOCKED|VM_MAYSHARE)) { == (VM_LOCKED|VM_MAYSHARE)) {