Skip to content

Commit 0c335d5

Browse files
committed
Revert "powerpc/numa: Fix percpu allocations to be NUMA aware"
This reverts commit 8c92870 which is commit ba4a648 upstream. Michal Hocko writes: JFYI. We have encountered a regression after applying this patch on a large ppc machine. While the patch is the right thing to do it doesn't work well with the current vmalloc area size on ppc and large machines where NUMA nodes are very far from each other. Just for the reference the boot fails on such a machine with bunch of warning preceeding it. See http://lkml.kernel.org/r/[email protected] It seems the right thing to do is to enlarge the vmalloc space on ppc but this is not the case in the upstream kernel yet AFAIK. It is also questionable whether that is a stable material but I will decision on you here. We have reverted this patch from our 4.4 based kernel. Newer kernels do not have enlarged vmalloc space yet AFAIK so they won't work properly eiter. This bug is quite rare though because you need a specific HW configuration to trigger the issue - namely NUMA nodes have to be far away from each other in the physical memory space. Cc: Michal Hocko <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fcd35f5 commit 0c335d5

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

arch/powerpc/include/asm/topology.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,8 @@ extern void __init dump_numa_cpu_topology(void);
4444
extern int sysfs_add_device_to_node(struct device *dev, int nid);
4545
extern void sysfs_remove_device_from_node(struct device *dev, int nid);
4646

47-
static inline int early_cpu_to_node(int cpu)
48-
{
49-
int nid;
50-
51-
nid = numa_cpu_lookup_table[cpu];
52-
53-
/*
54-
* Fall back to node 0 if nid is unset (it should be, except bugs).
55-
* This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
56-
*/
57-
return (nid < 0) ? 0 : nid;
58-
}
5947
#else
6048

61-
static inline int early_cpu_to_node(int cpu) { return 0; }
62-
6349
static inline void dump_numa_cpu_topology(void) {}
6450

6551
static inline int sysfs_add_device_to_node(struct device *dev, int nid)

arch/powerpc/kernel/setup_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ void __init setup_arch(char **cmdline_p)
751751

752752
static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
753753
{
754-
return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align,
754+
return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
755755
__pa(MAX_DMA_ADDRESS));
756756
}
757757

@@ -762,7 +762,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size)
762762

763763
static int pcpu_cpu_distance(unsigned int from, unsigned int to)
764764
{
765-
if (early_cpu_to_node(from) == early_cpu_to_node(to))
765+
if (cpu_to_node(from) == cpu_to_node(to))
766766
return LOCAL_DISTANCE;
767767
else
768768
return REMOTE_DISTANCE;

0 commit comments

Comments
 (0)