Daniel Vacek
99b6ead444
Revert "mm: page_alloc: skip over regions of invalid pfns where possible"
...
commit f59f1caf72ba00d519c793c3deb32cd3be32edc2 upstream.
This reverts commit b92df1de5d28 ("mm: page_alloc: skip over regions of
invalid pfns where possible"). The commit is meant to be a boot init
speed up skipping the loop in memmap_init_zone() for invalid pfns.
But given some specific memory mapping on x86_64 (or more generally
theoretically anywhere but on arm with CONFIG_HAVE_ARCH_PFN_VALID) the
implementation also skips valid pfns which is plain wrong and causes
'kernel BUG at mm/page_alloc.c:1389!'
crash> log | grep -e BUG -e RIP -e Call.Trace -e move_freepages_block -e rmqueue -e freelist -A1
kernel BUG at mm/page_alloc.c:1389!
invalid opcode: 0000 [#1 ] SMP
--
RIP: 0010: move_freepages+0x15e/0x160
--
Call Trace:
move_freepages_block+0x73/0x80
__rmqueue+0x263/0x460
get_page_from_freelist+0x7e1/0x9e0
__alloc_pages_nodemask+0x176/0x420
--
crash> page_init_bug -v | grep RAM
<struct resource 0xffff88067fffd2f8> 1000 - 9bfff System RAM (620.00 KiB)
<struct resource 0xffff88067fffd3a0> 100000 - 430bffff System RAM ( 1.05 GiB = 1071.75 MiB = 1097472.00 KiB)
<struct resource 0xffff88067fffd410> 4b0c8000 - 4bf9cfff System RAM ( 14.83 MiB = 15188.00 KiB)
<struct resource 0xffff88067fffd480> 4bfac000 - 646b1fff System RAM (391.02 MiB = 400408.00 KiB)
<struct resource 0xffff88067fffd560> 7b788000 - 7b7fffff System RAM (480.00 KiB)
<struct resource 0xffff88067fffd640> 100000000 - 67fffffff System RAM ( 22.00 GiB)
crash> page_init_bug | head -6
<struct resource 0xffff88067fffd560> 7b788000 - 7b7fffff System RAM (480.00 KiB)
<struct page 0xffffea0001ede200> 1fffff00000000 0 <struct pglist_data 0xffff88047ffd9000> 1 <struct zone 0xffff88047ffd9800> DMA32 4096 1048575
<struct page 0xffffea0001ede200> 505736 505344 <struct page 0xffffea0001ed8000> 505855 <struct page 0xffffea0001edffc0>
<struct page 0xffffea0001ed8000> 0 0 <struct pglist_data 0xffff88047ffd9000> 0 <struct zone 0xffff88047ffd9000> DMA 1 4095
<struct page 0xffffea0001edffc0> 1fffff00000400 0 <struct pglist_data 0xffff88047ffd9000> 1 <struct zone 0xffff88047ffd9800> DMA32 4096 1048575
BUG, zones differ!
crash> kmem -p 77fff000 78000000 7b5ff000 7b600000 7b787000 7b788000
PAGE PHYSICAL MAPPING INDEX CNT FLAGS
ffffea0001e00000 78000000 0 0 0 0
ffffea0001ed7fc0 7b5ff000 0 0 0 0
ffffea0001ed8000 7b600000 0 0 0 0 <<<<
ffffea0001ede1c0 7b787000 0 0 0 0
ffffea0001ede200 7b788000 0 0 1 1fffff00000000
Link: http://lkml.kernel.org/r/20180316143855.29838-1-neelx@redhat.com
Fixes: b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible")
Signed-off-by: Daniel Vacek <neelx@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: <stable@vger.kernel.org>
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>
2018-03-28 18:24:39 +02:00
..
2017-11-02 11:10:55 +01:00
2017-09-11 14:16:44 -06:00
2017-09-08 18:26:46 -07:00
2017-11-02 11:10:55 +01:00
2017-06-05 16:59:12 +02:00
2017-11-02 11:10:55 +01:00
2017-10-13 16:18:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-02-27 18:43:47 -08:00
2018-02-25 11:08:03 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:24 -07:00
2018-03-03 10:24:21 +01:00
2016-07-26 16:19:19 -07:00
2017-12-10 13:40:43 +01:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:46 -07:00
2018-03-28 18:24:39 +02:00
2016-05-20 17:58:30 -07:00
2018-03-28 18:24:38 +02:00
2017-05-03 15:52:12 -07:00
2017-11-02 11:10:55 +01:00
2017-09-06 17:27:30 -07:00
2017-09-08 18:26:49 -07:00
2017-09-08 18:26:46 -07:00
2018-02-22 15:42:24 +01:00
2018-03-28 18:24:38 +02:00
2016-03-17 15:09:34 -07:00
2018-02-22 15:42:23 +01:00
2017-10-03 17:54:23 -07:00
2017-10-03 17:54:25 -07:00
2016-05-22 17:21:27 -07:00
2017-12-05 11:26:29 +01:00
2018-02-22 15:42:24 +01:00
2018-03-28 18:24:39 +02:00
2018-02-13 10:19:48 +01:00
2017-10-03 17:54:26 -07:00
2018-02-22 15:42:31 +01:00
2018-02-22 15:42:27 +01:00
2017-10-13 16:18:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-03-17 15:09:34 -07:00
2017-12-20 10:10:18 +01:00
2017-03-02 08:42:38 +01:00
2017-08-31 16:13:00 -07:00
2017-11-02 11:10:55 +01:00
2018-01-10 09:31:17 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 18:13:32 -07:00
2017-12-20 10:10:18 +01:00
2018-03-28 18:24:39 +02:00
2017-11-02 11:10:55 +01:00
2017-11-24 08:37:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-23 19:58:21 +01:00
2017-09-06 17:27:29 -07:00
2017-11-24 08:37:04 +01:00
2017-11-02 11:10:55 +01:00
2017-07-26 17:41:05 -04:00
2017-09-27 14:45:57 -07:00
2017-06-29 11:23:38 -04:00
2017-10-19 13:13:49 +01:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:28 +01:00
2017-11-02 11:10:55 +01:00
2016-12-12 18:55:08 -08:00
2017-09-08 18:26:49 -07:00
2017-10-03 17:54:24 -07:00
2018-03-28 18:24:39 +02:00
2018-02-22 15:42:23 +01:00
2018-02-22 15:42:23 +01:00
2018-02-22 15:42:23 +01:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:24 +01:00
2017-11-02 11:10:55 +01:00
2018-01-10 09:31:17 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:24 -07:00
2017-11-03 07:39:19 -07:00
2017-07-10 16:32:32 -07:00
2017-04-05 12:30:18 -07:00
2017-09-06 17:27:28 -07:00
2017-09-06 17:27:29 -07:00
2017-11-02 11:10:55 +01:00
2018-02-25 11:08:04 +01:00
2017-07-10 16:32:31 -07:00
2018-02-25 11:07:46 +01:00
2017-09-08 18:26:47 -07:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:44 +00:00
2016-01-15 11:40:52 -08:00
2015-11-06 17:50:42 -08:00
2017-12-14 09:53:10 +01:00
2018-02-28 10:19:41 +01:00