linux/arch/ia64/kernel
Vlastimil Babka 96db800f5d mm: rename alloc_pages_exact_node() to __alloc_pages_node()
alloc_pages_exact_node() was introduced in commit 6484eb3e2a ("page
allocator: do not check NUMA node ID when the caller knows the node is
valid") as an optimized variant of alloc_pages_node(), that doesn't
fallback to current node for nid == NUMA_NO_NODE.  Unfortunately the
name of the function can easily suggest that the allocation is
restricted to the given node and fails otherwise.  In truth, the node is
only preferred, unless __GFP_THISNODE is passed among the gfp flags.

The misleading name has lead to mistakes in the past, see for example
commits 5265047ac3 ("mm, thp: really limit transparent hugepage
allocation to local node") and b360edb43f ("mm, mempolicy:
migrate_to_node should only migrate to node").

Another issue with the name is that there's a family of
alloc_pages_exact*() functions where 'exact' means exact size (instead
of page order), which leads to more confusion.

To prevent further mistakes, this patch effectively renames
alloc_pages_exact_node() to __alloc_pages_node() to better convey that
it's an optimized variant of alloc_pages_node() not intended for general
usage.  Both functions get described in comments.

It has been also considered to really provide a convenience function for
allocations restricted to a node, but the major opinion seems to be that
__GFP_THISNODE already provides that functionality and we shouldn't
duplicate the API needlessly.  The number of users would be small
anyway.

Existing callers of alloc_pages_exact_node() are simply converted to
call __alloc_pages_node(), with the exception of sba_alloc_coherent()
which open-codes the check for NUMA_NO_NODE, so it is converted to use
alloc_pages_node() instead.  This means it no longer performs some
VM_BUG_ON checks, and since the current check for nid in
alloc_pages_node() uses a 'nid < 0' comparison (which includes
NUMA_NO_NODE), it may hide wrong values which would be previously
exposed.

Both differences will be rectified by the next patch.

To sum up, this patch makes no functional changes, except temporarily
hiding potentially buggy callers.  Restricting the checks in
alloc_pages_node() is left for the next patch which can in turn expose
more existing buggy callers.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Robin Holt <robinmholt@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mel Gorman <mgorman@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Cliff Whickman <cpw@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-08 15:35:28 -07:00
..
.gitignore
acpi-ext.c ACPICA: Resources: Provide common part for struct acpi_resource_address structures. 2015-01-26 16:09:56 +01:00
acpi.c Initial ACPI support for arm64: 2015-04-24 08:23:45 -07:00
asm-offsets.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
audit.c
brl_emu.c
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
crash.c ia64: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
cyclone.c ia64: Replace clocksource.fsys_mmio with generic arch data 2011-07-14 17:57:09 -07:00
dma-mapping.c ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi_stub.S
efi.c The libnvdimm sub-system introduces, in addition to the libnvdimm-core, 2015-06-29 10:34:42 -07:00
elfcore.c switch elf_core_write_extra_data() to dump_emit() 2013-11-09 00:16:23 -05:00
entry.h
entry.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
err_inject.c ia64, err-inject: Fix CPU hotplug callback registration 2014-03-20 13:43:41 +01:00
esi_stub.S
esi.c
fsys.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c ftrace: Do not pass data to ftrace_dyn_arch_init 2014-03-07 10:06:14 -05:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
gate.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
head.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
ia64_ksyms.c ia64: export flush_icache_range for module use 2015-06-15 14:58:24 -07:00
init_task.c Rename .data.init_task to .data..init_task. 2010-03-03 11:25:58 +01:00
iosapic.c ia64/iosapic: Use irq_set_chip_handler_name_locked() 2015-07-27 13:36:37 +02:00
irq_ia64.c ia64: remove deprecated cpus_ usage. 2015-03-10 13:54:38 +10:30
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
irq.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
ivt.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
jprobes.S
kprobes.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
machine_kexec.c ia64: expose number of page table levels on Kconfig level 2015-04-14 16:49:02 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca_asm.S
mca_drv_asm.S
mca_drv.c Remove cast for kmalloc return value 2013-03-19 16:14:53 -07:00
mca_drv.h
mca.c ia64: Use setup_timer 2015-06-15 15:45:18 -07:00
minstate.h ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
module.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
msi_ia64.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
nr-irqs.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
numa.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
pal.S
palinfo.c ia64, palinfo: Fix CPU hotplug callback registration 2014-03-20 13:43:40 +01:00
patch.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
pci-dma.c [IA64] pci: Remove unused fallback_dev 2013-06-03 16:04:31 -07:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
perfmon.c VFS: assorted weird filesystems: d_inode() annotations 2015-04-15 15:06:58 -04:00
process.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
relocate_kernel.S
sal.c
salinfo.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
setup.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
sigframe.h
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
smpboot.c Nobody cares about paravirtualization on ia64 anymore 2015-06-22 20:33:38 -07:00
stacktrace.c [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
topology.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
traps.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
unaligned.c [IA64] use __ratelimit 2010-05-18 14:45:54 -07:00
uncached.c mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
unwind_decoder.c
unwind_i.h
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
vmlinux.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00