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-08-14 12:48:11 +02:00
2014-04-18 14:20:41 +02:00
2014-04-18 14:20:41 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2014-05-28 13:35:35 +10:00
2013-04-18 13:03:53 +10:00
2014-04-09 12:53:28 +10:00
2012-03-28 18:30:02 +01:00
2014-01-23 16:36:54 -08:00
2011-11-08 14:51:46 +11:00
2014-06-25 18:49:40 -05:00
2012-03-20 21:48:30 +08:00
2014-09-24 23:19:45 +02:00
2014-09-24 23:19:45 +02:00
2010-06-09 11:12:36 +02:00
2011-07-26 16:49:47 -07:00
2013-12-09 11:40:25 +11:00
2014-07-28 14:10:23 +10:00
2010-05-05 09:11:10 -04:00
2014-07-28 14:10:23 +10:00
2014-10-08 20:15:52 +11:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2014-06-26 13:19:42 +02:00
2009-12-09 17:10:37 +11:00
2014-04-07 10:33:12 +10:00
2013-11-06 14:13:49 +11:00
2013-11-26 12:12:28 +01:00
2012-09-17 16:31:51 +10:00
2011-03-31 11:26:23 -03:00
2014-06-24 12:43:15 +10:00
2014-10-22 14:03:06 +11:00
2014-07-11 16:06:08 +10:00
2014-10-22 14:03:06 +11:00
2011-03-31 11:26:23 -03:00
2014-02-17 11:19:37 +11:00
2013-10-30 16:02:28 +11:00