remarkable-linux/include
Gerald Schaefer 082d5b6b60 mm/hugetlb: check for reserved hugepages during memory offline
In dissolve_free_huge_pages(), free hugepages will be dissolved without
making sure that there are enough of them left to satisfy hugepage
reservations.

Fix this by adding a return value to dissolve_free_huge_pages() and
checking h->free_huge_pages vs.  h->resv_huge_pages.  Note that this may
lead to the situation where dissolve_free_huge_page() returns an error
and all free hugepages that were dissolved before that error are lost,
while the memory block still cannot be set offline.

Fixes: c8721bbb ("mm: memory-hotplug: enable memory hotplug to handle hugepage")
Link: http://lkml.kernel.org/r/20160926172811.94033-3-gerald.schaefer@de.ibm.com
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Rui Teng <rui.teng@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-07 18:46:29 -07:00
..
acpi Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
asm-generic mm: move phys_mem_access_prot_allowed() declaration to pgtable.h 2016-10-07 18:46:29 -07:00
clocksource
crypto
drm
dt-bindings - Core Frameworks 2016-10-07 08:35:35 -07:00
keys
kvm ARM: KVM: Support vgic-v3 2016-09-22 13:22:21 +02:00
linux mm/hugetlb: check for reserved hugepages during memory offline 2016-10-07 18:46:29 -07:00
math-emu
media
memory
misc
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-10-06 09:52:23 -07:00
pcmcia
ras
rdma IB/core: Add ib headers for general use 2016-10-02 08:40:35 -04:00
rxrpc rxrpc: Add tracepoint for ACK proposal 2016-09-23 15:49:19 +01:00
scsi Merge remote-tracking branch 'mkp-scsi/4.8/scsi-fixes' into fixes 2016-09-27 22:30:51 -07:00
soc The core clk framework changes are small again. They're mostly minor fixes 2016-10-04 11:04:57 -07:00
sound ASoC: Updates for v4.9 2016-09-30 18:40:40 +02:00
target
trace mm, compaction: rename COMPACT_PARTIAL to COMPACT_SUCCESS 2016-10-07 18:46:27 -07:00
uapi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2016-10-07 11:58:38 -07:00
video
xen xen: features and fixes for 4.9-rc0 2016-10-06 11:19:10 -07:00
Kbuild