Kirill A. Shutemov c164e038ee mm: fix huge zero page accounting in smaps report
As a small zero page, huge zero page should not be accounted in smaps
report as normal page.

For small pages we rely on vm_normal_page() to filter out zero page, but
vm_normal_page() is not designed to handle pmds.  We only get here due
hackish cast pmd to pte in smaps_pte_range() -- pte and pmd format is not
necessary compatible on each and every architecture.

Let's add separate codepath to handle pmds.  follow_trans_huge_pmd() will
detect huge zero page for us.

We would need pmd_dirty() helper to do this properly.  The patch adds it
to THP-enabled architectures which don't yet have one.

[akpm@linux-foundation.org: use do_div to fix 32-bit build]
Signed-off-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Tested-by: Fengwei Yin <yfw.kernel@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-10 17:41:08 -08:00
..
2014-10-09 02:39:04 -04:00
2014-10-14 08:40:15 +02:00
2014-11-13 22:19:05 +03:00
2014-12-03 09:36:03 -08:00
2014-10-09 02:38:57 -04:00
2014-10-16 12:53:35 +01:00
2014-12-10 17:41:04 -08:00
2014-11-20 16:40:02 +01:00
2014-10-09 13:06:14 +02:00
2014-11-07 08:33:52 +11:00
2014-11-18 02:01:40 +01:00
2014-10-24 00:14:38 +02:00
2014-10-24 00:14:35 +02:00
2014-08-26 09:35:56 +02:00
2014-08-27 11:17:48 +02:00