This is a note to let you know that I've just added the patch titled Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-powerpc-numa-fix-percpu-allocations-to-be-numa-aware.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2c12a32c20594139ddc5aa11245fd7cbe00a61b7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Thu, 3 Aug 2017 12:26:04 -0700 Subject: Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> This reverts commit b4624ff952ec7d268a9651cd9184a1995befc271 which is commit ba4a648f12f4cd0a8003dd229b6ca8a53348ee4b 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/20170724134240.GL25221@xxxxxxxxxxxxxx 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 <mhocko@xxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Nicholas Piggin <npiggin@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/include/asm/topology.h | 14 -------------- arch/powerpc/kernel/setup_64.c | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -44,22 +44,8 @@ extern void __init dump_numa_cpu_topolog extern int sysfs_add_device_to_node(struct device *dev, int nid); extern void sysfs_remove_device_from_node(struct device *dev, int nid); -static inline int early_cpu_to_node(int cpu) -{ - int nid; - - nid = numa_cpu_lookup_table[cpu]; - - /* - * Fall back to node 0 if nid is unset (it should be, except bugs). - * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)). - */ - return (nid < 0) ? 0 : nid; -} #else -static inline int early_cpu_to_node(int cpu) { return 0; } - static inline void dump_numa_cpu_topology(void) {} static inline int sysfs_add_device_to_node(struct device *dev, int nid) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -595,7 +595,7 @@ void __init emergency_stack_init(void) static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align) { - return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align, + return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align, __pa(MAX_DMA_ADDRESS)); } @@ -606,7 +606,7 @@ static void __init pcpu_fc_free(void *pt static int pcpu_cpu_distance(unsigned int from, unsigned int to) { - if (early_cpu_to_node(from) == early_cpu_to_node(to)) + if (cpu_to_node(from) == cpu_to_node(to)) return LOCAL_DISTANCE; else return REMOTE_DISTANCE; Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-4.9/parisc-suspend-lockup-detectors-before-system-halt.patch queue-4.9/revert-powerpc-numa-fix-percpu-allocations-to-be-numa-aware.patch queue-4.9/kvm-ppc-book3s-hv-save-restore-host-values-of-debug-registers.patch queue-4.9/drm-nouveau-disp-nv50-bump-max-chans-to-21.patch queue-4.9/drm-nouveau-bar-gf100-fix-access-to-upper-half-of-bar2.patch queue-4.9/pstore-make-spinlock-per-zone-instead-of-global.patch queue-4.9/kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch queue-4.9/alsa-fm801-initialize-chip-after-irq-handler-is-registered.patch queue-4.9/md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch queue-4.9/parisc-prevent-tlb-speculation-on-flushed-pages-on-cpus-that-only-support-equivalent-aliases.patch queue-4.9/powerpc-pseries-fix-of_node_put-underflow-during-reconfig-remove.patch queue-4.9/nfs-invalidate-file-size-when-taking-a-lock.patch queue-4.9/af_key-add-lock-to-key-dump.patch queue-4.9/jfs-don-t-clear-sgid-when-inheriting-acls.patch queue-4.9/drm-vmwgfx-fix-gcc-7.1.1-warning.patch queue-4.9/crypto-authencesn-fix-digest_null-crash.patch queue-4.9/net-reduce-skb_warn_bad_offload-noise.patch queue-4.9/kvm-ppc-book3s-hv-restore-critical-sprs-to-host-values-on-guest-exit.patch queue-4.9/alsa-hda-add-missing-nvidia-gpu-codec-ids-to-patch-table.patch queue-4.9/nfsv4.1-fix-a-race-where-cb_notify_lock-fails-to-wake-a-waiter.patch queue-4.9/parisc-extend-disabled-preemption-in-copy_user_page.patch