diff options
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r-- | fs/proc/task_mmu.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 25b6a887adb..61342a454bd 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -877,30 +877,31 @@ struct numa_maps_private { | |||
877 | struct numa_maps md; | 877 | struct numa_maps md; |
878 | }; | 878 | }; |
879 | 879 | ||
880 | static void gather_stats(struct page *page, struct numa_maps *md, int pte_dirty) | 880 | static void gather_stats(struct page *page, struct numa_maps *md, int pte_dirty, |
881 | unsigned long nr_pages) | ||
881 | { | 882 | { |
882 | int count = page_mapcount(page); | 883 | int count = page_mapcount(page); |
883 | 884 | ||
884 | md->pages++; | 885 | md->pages += nr_pages; |
885 | if (pte_dirty || PageDirty(page)) | 886 | if (pte_dirty || PageDirty(page)) |
886 | md->dirty++; | 887 | md->dirty += nr_pages; |
887 | 888 | ||
888 | if (PageSwapCache(page)) | 889 | if (PageSwapCache(page)) |
889 | md->swapcache++; | 890 | md->swapcache += nr_pages; |
890 | 891 | ||
891 | if (PageActive(page) || PageUnevictable(page)) | 892 | if (PageActive(page) || PageUnevictable(page)) |
892 | md->active++; | 893 | md->active += nr_pages; |
893 | 894 | ||
894 | if (PageWriteback(page)) | 895 | if (PageWriteback(page)) |
895 | md->writeback++; | 896 | md->writeback += nr_pages; |
896 | 897 | ||
897 | if (PageAnon(page)) | 898 | if (PageAnon(page)) |
898 | md->anon++; | 899 | md->anon += nr_pages; |
899 | 900 | ||
900 | if (count > md->mapcount_max) | 901 | if (count > md->mapcount_max) |
901 | md->mapcount_max = count; | 902 | md->mapcount_max = count; |
902 | 903 | ||
903 | md->node[page_to_nid(page)]++; | 904 | md->node[page_to_nid(page)] += nr_pages; |
904 | } | 905 | } |
905 | 906 | ||
906 | static int gather_pte_stats(pmd_t *pmd, unsigned long addr, | 907 | static int gather_pte_stats(pmd_t *pmd, unsigned long addr, |
@@ -931,7 +932,7 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr, | |||
931 | if (!node_isset(nid, node_states[N_HIGH_MEMORY])) | 932 | if (!node_isset(nid, node_states[N_HIGH_MEMORY])) |
932 | continue; | 933 | continue; |
933 | 934 | ||
934 | gather_stats(page, md, pte_dirty(*pte)); | 935 | gather_stats(page, md, pte_dirty(*pte), 1); |
935 | 936 | ||
936 | } while (pte++, addr += PAGE_SIZE, addr != end); | 937 | } while (pte++, addr += PAGE_SIZE, addr != end); |
937 | pte_unmap_unlock(orig_pte, ptl); | 938 | pte_unmap_unlock(orig_pte, ptl); |
@@ -952,7 +953,7 @@ static int gather_hugetbl_stats(pte_t *pte, unsigned long hmask, | |||
952 | return 0; | 953 | return 0; |
953 | 954 | ||
954 | md = walk->private; | 955 | md = walk->private; |
955 | gather_stats(page, md, pte_dirty(*pte)); | 956 | gather_stats(page, md, pte_dirty(*pte), 1); |
956 | return 0; | 957 | return 0; |
957 | } | 958 | } |
958 | 959 | ||