Skip to content

CPU hotplug error handling fixes take2

Akinobu Mita lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9slab: cleanup cpuup_callback()mm/slab.c+159 -1420 replies
2/9slab: fix memory leak in cpu hotplug error pathmm/slab.c+8 -21 reply
3/9cpu: deliver CPU_UP_CANCELED only to NOTIFY_OKed callbacks with CPU_UP_PREPAREkernel/cpu.c+2 -01 reply
4/9topology: remove topology_dev_mapdrivers/base/topology.c+1 -101 reply
5/9thermal_throttle: fix cpu hotplug error handlingarch/i386/kernel/cpu/mcheck/therm_throt.c+6 -40 replies
6/9msr: fix cpu hotplug error handlingarch/i386/kernel/msr.c+19 -130 replies
7/9cpuid: fix cpu hotplug error handlingarch/i386/kernel/cpuid.c+19 -130 replies
8/9mce: fix cpu hotplug error handlingarch/x86_64/kernel/mce.c+29 -100 replies
9/9intel_cacheinfo: fix cpu hotplug error handlingarch/i386/kernel/cpu/intel_cacheinfo.c+45 -190 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchGreg Kroah-HartmanPekka Enberg
1/9
2/9A-b
3/9
4/9A-b
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 0/9] CPU hotplug error handling fixes take2

This series of patches fixes the error handling for cpu hotplug. The problem is revealed by CPU hotplug/unplug test with fault-injection.

The changes from previous patchset:

- Removed the patch titled sysfs: avoid kmem_cache_free(NULL) Because it was merged into mainline.

- Removed the patch titled sysdev: add error check in sysdev_register() It turned out that the patch needs more fixes for microcode and cpufreq. So I'll separate them from this series of patches.

- Added slab fix noticed by Gautham R Shenoy

The series of patches:

[patch 1/9] slab: cleanup cpuup_callback()
[patch 2/9] slab: fix memory leak in cpu hotplug error path [patch 3/9] cpu: deliver CPU_UP_CANCELED only to NOTIFY_OKed callbacks
with CPU_UP_PREPARE
[patch 4/9] topology: remove topology_dev_map
[patch 5/9] thermal_throttle: fix cpu hotplug error handling [patch 6/9] msr: fix cpu hotplug error handling
[patch 7/9] cpuid: fix cpu hotplug error handling
[patch 8/9] mce: fix cpu hotplug error handling
[patch 9/9] intel_cacheinfo: fix cpu hotplug error handling

The patch 1/9 factors out some code from cpuup_callback() to simplify what the patch 2/9 does.

The patch 2/9 fixes memory leak in allocation failure path. Also it avoids the memory leak that will be introduced by the patch 3/9.

The patch 3/9 changes the behavior when one of the callbacks in notifier chain returns NOTIFY_BAD with CPU_UP_PREPARE event. This change makes cpu hotplug error handling simple.

The patch 4/9 simplifies the cpu hotplug event handling in topology.c enabled by the patch 3/9.

The patch 5-9/9 are cpu hotplug error handling fixes in drivers. Mainly these patches shift some callbacks from CPU_ONLINE to CPU_UP_PREPARE.

CPU hotplug/unplug test script:

----------[ cut here ]----------

#!/bin/bash

FAILTYPE=failslab
CPU=1 CPU_ONLINE=/sys/devices/system/cpu/cpu${CPU}/online

faulty_system()

{
	bash -c "echo 1 > /proc/self/make-it-fail && exec $*"
}

[ "$UID" == 0 ] || exit 1
[ -n "$FAILTYPE" -a -f /debug/$FAILTYPE/probability ] || exit 1 [ -f $CPU_ONLINE ] || exit 1

echo N > /debug/$FAILTYPE/ignore-gfp-wait
echo Y > /debug/$FAILTYPE/task-filter
echo 1 > /debug/$FAILTYPE/probability
echo -1 > /debug/$FAILTYPE/times

while true
do
faulty_system "echo 0 > $CPU_ONLINE"
faulty_system "echo 1 > $CPU_ONLINE"
done