aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2015-11-05 21:47:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commit5d317b2b6536592a9b51fe65faed43d65ca9158e (patch)
treef6d51677a577802ddd873c2e01bf04c5aff1e3f1 /mm/rmap.c
parent25ee01a2fca02dfb5a3ce316e77910c468108199 (diff)
mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status
Currently there's no easy way to get per-process usage of hugetlb pages, which is inconvenient because userspace applications which use hugetlb typically want to control their processes on the basis of how much memory (including hugetlb) they use. So this patch simply provides easy access to the info via /proc/PID/status. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Acked-by: Joern Engel <joern@logfs.org> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Mike Kravetz <mike.kravetz@oracle.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index f5b5c1f3dcd7..d40e7aefb888 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1352,7 +1352,9 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
1352 update_hiwater_rss(mm); 1352 update_hiwater_rss(mm);
1353 1353
1354 if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { 1354 if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
1355 if (!PageHuge(page)) { 1355 if (PageHuge(page)) {
1356 hugetlb_count_sub(1 << compound_order(page), mm);
1357 } else {
1356 if (PageAnon(page)) 1358 if (PageAnon(page))
1357 dec_mm_counter(mm, MM_ANONPAGES); 1359 dec_mm_counter(mm, MM_ANONPAGES);
1358 else 1360 else