linux/arch/powerpc/platforms/cell
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
..
spufs powerpc/cell: Drop support for 64K local store on 4K kernels 2015-08-18 19:29:49 +10:00
axon_msi.c powerpc/PCI: Use for_pci_msi_entry() to access MSI device list 2015-07-22 18:37:42 +02:00
cbe_powerbutton.c
cbe_regs.c powerpc: various straight conversions from module.h --> export.h 2011-10-31 19:30:44 -04:00
cbe_thermal.c powerpc/cell: cbe_thermal.c: Cleaning up a variable is of the wrong type 2014-06-24 14:05:59 +10:00
cell.h powerpc/cell: Move controller ops from ppc_md to controller_ops 2015-04-11 20:49:17 +10:00
cpufreq_spudemand.c workqueue: make deferrable delayed_work initializer names consistent 2012-08-21 13:18:23 -07:00
interrupt.c genirq/irqdomain: Allow irq domain aliasing 2015-07-30 00:14:36 +02:00
interrupt.h
iommu.c powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table 2015-06-11 15:14:56 +10:00
Kconfig powerpc/cell: Drop support for 64K local store on 4K kernels 2015-08-18 19:29:49 +10:00
Makefile powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
pervasive.c powerpc: More fixes for lazy IRQ vs. idle 2012-07-10 19:16:07 +10:00
pervasive.h
pmu.c powerpc/cell: Only iterate over online nodes in cbe_init_pm_irq() 2013-04-24 14:22:30 +10:00
qpace_setup.c powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
ras.c mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
ras.h
setup.c powerpc/cell: Fix iommu breakage caused by controller_ops change 2015-04-14 17:13:31 +10:00
smp.c powerpc: Drop return value of smp_ops->probe() 2015-04-10 20:02:49 +10:00
spider-pci.c
spider-pic.c of/irq: Use irq_of_parse_and_map() 2013-10-24 11:50:35 +01:00
spu_base.c powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
spu_callbacks.c powerpc: Add a proper syscall for switching endianness 2015-03-28 22:03:40 +11:00
spu_manage.c of/irq: simplify args to irq_create_of_mapping 2013-10-24 11:42:57 +01:00
spu_notify.c powerpc: fix implicit notifier use in converting to export.h 2011-10-31 19:30:41 -04:00
spu_priv1_mmio.c powerpc: remove non-required uses of include <linux/module.h> 2011-10-31 19:30:44 -04:00
spu_priv1_mmio.h
spu_syscalls.c powerpc/cell: Fix compilation with CONFIG_COREDUMP=n 2014-07-11 12:55:05 +10:00