diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2010-03-05 16:41:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:23 -0500 |
commit | d559db086ff5be9bcc259e5aa50bf3d881eaf1d1 (patch) | |
tree | aa968c8a4093234e4623a34c0415bf9d8683671c /mm/rmap.c | |
parent | 19b629f581320999ddb9f6597051b79cdb53459c (diff) |
mm: clean up mm_counter
Presently, per-mm statistics counter is defined by macro in sched.h
This patch modifies it to
- defined in mm.h as inlinf functions
- use array instead of macro's name creation.
This patch is for reducing patch size in future patch to modify
implementation of per-mm counter.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -815,9 +815,9 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
815 | 815 | ||
816 | if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { | 816 | if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { |
817 | if (PageAnon(page)) | 817 | if (PageAnon(page)) |
818 | dec_mm_counter(mm, anon_rss); | 818 | dec_mm_counter(mm, MM_ANONPAGES); |
819 | else | 819 | else |
820 | dec_mm_counter(mm, file_rss); | 820 | dec_mm_counter(mm, MM_FILEPAGES); |
821 | set_pte_at(mm, address, pte, | 821 | set_pte_at(mm, address, pte, |
822 | swp_entry_to_pte(make_hwpoison_entry(page))); | 822 | swp_entry_to_pte(make_hwpoison_entry(page))); |
823 | } else if (PageAnon(page)) { | 823 | } else if (PageAnon(page)) { |
@@ -839,7 +839,7 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
839 | list_add(&mm->mmlist, &init_mm.mmlist); | 839 | list_add(&mm->mmlist, &init_mm.mmlist); |
840 | spin_unlock(&mmlist_lock); | 840 | spin_unlock(&mmlist_lock); |
841 | } | 841 | } |
842 | dec_mm_counter(mm, anon_rss); | 842 | dec_mm_counter(mm, MM_ANONPAGES); |
843 | } else if (PAGE_MIGRATION) { | 843 | } else if (PAGE_MIGRATION) { |
844 | /* | 844 | /* |
845 | * Store the pfn of the page in a special migration | 845 | * Store the pfn of the page in a special migration |
@@ -857,7 +857,7 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
857 | entry = make_migration_entry(page, pte_write(pteval)); | 857 | entry = make_migration_entry(page, pte_write(pteval)); |
858 | set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); | 858 | set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); |
859 | } else | 859 | } else |
860 | dec_mm_counter(mm, file_rss); | 860 | dec_mm_counter(mm, MM_FILEPAGES); |
861 | 861 | ||
862 | page_remove_rmap(page); | 862 | page_remove_rmap(page); |
863 | page_cache_release(page); | 863 | page_cache_release(page); |
@@ -996,7 +996,7 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, | |||
996 | 996 | ||
997 | page_remove_rmap(page); | 997 | page_remove_rmap(page); |
998 | page_cache_release(page); | 998 | page_cache_release(page); |
999 | dec_mm_counter(mm, file_rss); | 999 | dec_mm_counter(mm, MM_FILEPAGES); |
1000 | (*mapcount)--; | 1000 | (*mapcount)--; |
1001 | } | 1001 | } |
1002 | pte_unmap_unlock(pte - 1, ptl); | 1002 | pte_unmap_unlock(pte - 1, ptl); |