Files
linux/include/linux
Gerald Schaefer e513b90a9a numa: fix /proc/<pid>/numa_maps for THP
commit 28093f9f34 upstream.

In gather_pte_stats() a THP pmd is cast into a pte, which is wrong
because the layouts may differ depending on the architecture.  On s390
this will lead to inaccurate numa_maps accounting in /proc because of
misguided pte_present() and pte_dirty() checks on the fake pte.

On other architectures pte_present() and pte_dirty() may work by chance,
but there may be an issue with direct-access (dax) mappings w/o
underlying struct pages when HAVE_PTE_SPECIAL is set and THP is
available.  In vm_normal_page() the fake pte will be checked with
pte_special() and because there is no "special" bit in a pmd, this will
always return false and the VM_PFNMAP | VM_MIXEDMAP checking will be
skipped.  On dax mappings w/o struct pages, an invalid struct page
pointer would then be returned that can crash the kernel.

This patch fixes the numa_maps THP handling by introducing new "_pmd"
variants of the can_gather_numa_stats() and vm_normal_page() functions.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-04 14:48:49 -07:00
..
2016-03-03 15:07:26 -08:00
2015-10-01 12:48:11 -07:00
2015-06-25 11:49:31 +03:00
2015-10-17 21:22:08 -07:00
2015-10-07 18:08:15 +01:00
2015-08-27 20:47:09 +01:00
2015-05-13 12:04:55 -05:00
2015-03-25 20:28:11 -04:00
2016-03-09 15:34:52 -08:00
2015-11-07 10:40:47 -07:00
2015-10-07 16:02:49 -07:00
2015-09-04 16:54:41 -07:00
2015-02-12 18:54:15 -08:00
2015-09-08 15:35:28 -07:00
2016-04-20 15:42:12 +09:00
2015-10-18 10:14:39 -07:00
2015-01-21 19:21:30 +01:00
2014-11-10 09:27:30 -07:00
2014-12-31 13:06:50 -05:00
2015-10-30 01:47:27 -04:00
2014-10-09 11:35:48 +03:00
2015-06-24 17:49:45 -07:00
2014-10-08 16:01:41 -04:00
2016-04-20 15:42:12 +09:00
2014-08-06 18:01:24 -07:00
2015-05-12 10:46:53 +02:00
2015-09-08 15:35:28 -07:00
2015-03-16 21:45:54 +11:00
2015-05-05 13:40:42 -06:00
2014-06-06 16:08:13 -07:00
2016-04-20 15:42:02 +09:00
2015-10-23 05:44:28 -07:00
2014-06-02 14:56:01 -07:00
2015-08-27 19:40:58 -04:00
2015-10-01 15:06:43 +02:00
2015-10-13 19:01:25 +02:00
2015-06-25 12:06:45 +02:00
2014-03-13 12:11:00 +10:30
2015-08-18 15:49:15 -07:00
2015-07-28 08:50:42 +01:00
2015-04-29 17:17:17 -05:00
2015-11-23 09:44:58 +01:00
2014-05-27 17:38:11 -07:00
2015-04-14 16:49:05 -07:00
2015-10-27 18:55:31 -07:00
2015-06-24 17:49:41 -07:00
2016-05-04 14:48:49 -07:00
2015-10-20 22:10:45 +08:00
2015-07-21 10:39:05 -07:00
2014-03-04 13:51:06 -05:00
2014-01-27 21:02:39 -08:00
2015-06-25 04:20:04 -04:00
2016-03-03 15:07:28 -08:00
2014-01-25 03:14:05 -05:00
2015-03-11 17:56:28 -04:00
2014-11-04 13:29:38 +00:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-11-06 17:50:42 -08:00
2014-07-09 14:58:37 +01:00
2015-04-12 21:03:31 +02:00
2015-01-25 23:17:28 -05:00
2015-10-09 17:00:32 -04:00
2015-10-06 17:08:19 +02:00
2015-10-22 08:59:18 -07:00
2015-05-26 15:23:23 +02:00
2015-06-25 01:13:43 +02:00
2014-08-08 15:57:26 -07:00
2015-02-13 21:21:41 -08:00
2015-04-11 15:53:35 -04:00
2014-06-12 00:21:11 -04:00
2015-09-10 15:36:59 -04:00
2014-06-04 16:53:57 -07:00
2015-06-25 17:00:39 -07:00
2015-11-05 14:36:09 -05:00
2016-04-12 09:08:35 -07:00
2014-06-04 16:53:56 -07:00
2015-08-17 11:25:28 -07:00
2015-10-01 09:57:59 -07:00
2015-10-19 01:01:21 +02:00
2016-04-12 09:08:49 -07:00
2015-04-11 22:29:44 -04:00
2015-11-23 09:44:58 +01:00
2014-11-28 16:08:16 +01:00
2015-12-04 08:38:42 -07:00
2014-04-07 16:35:53 -07:00
2015-12-13 14:30:59 -08:00
2015-03-24 09:48:14 -07:00
2015-11-13 20:34:33 -05:00
2015-09-08 15:35:28 -07:00