Skip to content

workqueue: fix a bug when numa mapping is changed v4

Kamezawa Hiroyuki lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Changes since v3 from the cover letter

- removed changes against get_unbound_pool()
- remvoed codes in cpu offline event.
- added node unregister callback.
clear wq_numa_possible_mask at node offline rather than cpu offline.
- updates per-cpu pool's pool-> node at node_(un)register.
- added more comments.
- almost all codes are under CONFIG_MEMORY_HOTPLUG

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2workqueue: update numa affinity info at node hotpluginclude/linux/memory_hotplug.h kernel/workqueue.c mm/memory_hotplug.c+65 -218 replies
2/2workqueue: update cpumask at CPU_ONLINE if necessarykernel/workqueue.c+23 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] workqueue: fix a bug when numa mapping is changed v4

This is v4. Thank you for hints/commentes to previous versions.

I think this versions only contains necessary things and not invasive. Tested several patterns of node hotplug and seems to work well.

Changes since v3
- removed changes against get_unbound_pool()
- remvoed codes in cpu offline event.
- added node unregister callback.
clear wq_numa_possible_mask at node offline rather than cpu offline.
- updates per-cpu pool's pool-> node at node_(un)register.
- added more comments.
- almost all codes are under CONFIG_MEMORY_HOTPLUG

 include/linux/memory_hotplug.h |    3 +
 kernel/workqueue.c             |   81 ++++++++++++++++++++++++++++++++++++++++-
 mm/memory_hotplug.c            |    6 ++-
 3 files changed, 88 insertions(+), 2 deletions(-)

Original problem was a memory allocation failure because pool->node points to not-online node. This happens when cpu<->node mapping changes.

Yasuaki Ishimatsu hit a allocation failure bug when the numa mapping between CPU and node is changed. This was the last scene:
SLUB: Unable to allocate memory on node 2 (gfp=0x80d0)
cache: kmalloc-192, object size: 192, buffer size: 192, default order: 1, min order: 0 node 0: slabs: 6172, objs: 259224, free: 245741
node 1: slabs: 3261, objs: 136962, free: 127656