Skip to content

CPU hotplug, cpusets: Fix issues with cpusets handling during suspend/resume

Srivatsa S. Bhat lkml 2 versions – In review

Get series with b4
b4 am 20120513231325.3566.37740.stgit@srivatsabhat

Versions newest first · linked by author and title

  1. v3 Latest5 patches 35 repliesIn review
  2. v27 patches 24 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5cpusets, hotplug: Implement cpuset tree traversal in a helper functionkernel/cpuset.c+18 -83 replies
2/5cpusets, hotplug: Restructure functions that are invoked during hotpluginclude/linux/cpuset.h kernel/cpuset.c kernel/sched/core.c+67 -322 replies
3/5cpusets: Update tasks' cpus_allowed mask upon updates to root cpusetkernel/cpuset.c+27 -81 reply
4/5cpusets: Add provisions for distinguishing CPU Hotplug in suspend/resume pathinclude/linux/cpuset.h kernel/cpuset.c kernel/sched/core.c+40 -105 replies
5/5cpusets, suspend: Save and restore cpusets during suspend/resumekernel/cpuset.c+79 -522 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchDavid Rientjes
1/5
2/5
3/5A-b
4/5
5/5

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

Read the v3 thread

Cover letter [PATCH v3 0/5] CPU hotplug, cpusets: Fix issues with cpusets handling during suspend/resume

Currently the kernel doesn't handle cpusets properly during suspend/resume. After a resume, all non-root cpusets end up having only 1 cpu (the boot cpu), causing massive performance degradation of workloads. One major user of cpusets is libvirt, which means that after a suspend/hibernation cycle, all VMs suddenly end up running terribly slow!

Also, the kernel moves the tasks from one cpuset to another during CPU hotplug in the suspend/resume path, leading to a task-management nightmare after resume.

This patchset solves these problems by reworking the way cpusets are handled during CPU hotplug in the suspend/resume path. This doesn't involve any change in semantics as to how cpusets are handled during regular CPU hotplug because it is correct as it is.

Patches 1 & 2 are cleanups that separate out hotplug handling so that we can implement different logic for different hotplug events (CPU/Mem online/offline). This also leads to some optimizations and more importantly prepares the ground for any further work dealing with cpusets during hotplug.

Patch 3 is a bug fix - it ensures that the tasks attached to the root cpuset see the updated cpus_allowed mask upon CPU hotplug.

Patches 4 and 5 implement the fix for cpusets handling during suspend/resume.

--
Srivatsa S. Bhat (5):
cpusets, hotplug: Implement cpuset tree traversal in a helper function cpusets, hotplug: Restructure functions that are invoked during hotplug
cpusets: Update tasks' cpus_allowed mask upon updates to root cpuset
cpusets: Add provisions for distinguishing CPU Hotplug in suspend/resume path cpusets, suspend: Save and restore cpusets during suspend/resume

  include/linux/cpuset.h |    4 -
 kernel/cpuset.c        |  235 +++++++++++++++++++++++++++++++++++++++---------
 kernel/sched/core.c    |   29 +++++-
 3 files changed, 218 insertions(+), 50 deletions(-)

Thanks,
Srivatsa S. Bhat
IBM Linux Technology Center