1
0
Fork 0
remarkable-linux/include
Michal Hocko 8b91323889 mm: unify new_node_page and alloc_migrate_target
Commit 394e31d2ce ("mem-hotplug: alloc new page from a nearest
neighbor node when mem-offline") has duplicated a large part of
alloc_migrate_target with some hotplug specific special casing.

To be more precise it tried to enfore the allocation from a different
node than the original page.  As a result the two function diverged in
their shared logic, e.g.  the hugetlb allocation strategy.

Let's unify the two and express different NUMA requirements by the given
nodemask.  new_node_page will simply exclude the node it doesn't care
about and alloc_migrate_target will use all the available nodes.
alloc_migrate_target will then learn to migrate hugetlb pages more
sanely and use preallocated pool when possible.

Please note that alloc_migrate_target used to call alloc_page resp.
alloc_pages_current so the memory policy of the current context which is
quite strange when we consider that it is used in the context of
alloc_contig_range which just tries to migrate pages which stand in the
way.

Link: http://lkml.kernel.org/r/20170608074553.22152-4-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Xishi Qiu <qiuxishi@huawei.com>
Cc: zhong jiang <zhongjiang@huawei.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-10 16:32:31 -07:00
..
acpi arm64 updates for 4.13: 2017-07-05 17:09:27 -07:00
asm-generic powerpc updates for 4.13 2017-07-07 13:55:45 -07:00
clocksource
crypto crypto: engine - replace pr_xxx by dev_xxx 2017-06-19 14:19:54 +08:00
drm main drm pull for v4.13 2017-07-09 18:48:37 -07:00
dt-bindings This is the bulk of GPIO changes for the v4.13 series: 2017-07-07 12:40:27 -07:00
keys
kvm KVM: arm64: vgic-v3: Add hook to handle guest GICv3 sysreg accesses at EL2 2017-06-15 09:44:59 +01:00
linux mm: unify new_node_page and alloc_migrate_target 2017-07-10 16:32:31 -07:00
math-emu
media main drm pull for v4.13 2017-07-09 18:48:37 -07:00
memory
misc cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-07-08 12:01:22 -07:00
pcmcia
ras trace, ras: add ARM processor error trace event 2017-06-22 18:22:05 +01:00
rdma Fixes #3 for 4.12-rc 2017-07-06 11:45:08 -07:00
rxrpc
scsi SCSI misc on 20170704 2017-07-06 12:10:33 -07:00
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
sound ASoC: Updates for v4.13 2017-07-03 19:51:42 +02:00
target
trace oom, trace: remove ENUM evaluation of COMPACTION_FEEDBACK 2017-07-10 16:32:31 -07:00
uapi main drm pull for v4.13 2017-07-09 18:48:37 -07:00
video imx-drm: cleanups and YUV 4:2:0 memory read/write reduction support 2017-06-16 10:05:38 +10:00
xen This is the first pull request for the new dma-mapping subsystem 2017-07-06 19:20:54 -07:00