)]}'
{
  "commit": "acec9637e03ca54bd3c3a0c1a6ad5c6dfa07c0df",
  "tree": "ed1bf085a62834fb05c34dc61f5acfdedca8e7f0",
  "parents": [
    "42ef815ff6b282e75248e8e084508fca4a694b70"
  ],
  "author": {
    "name": "Ridong Chen",
    "email": "chenridong@xiaomi.com",
    "time": "Sat Nov 14 20:05:32 2026 +0800"
  },
  "committer": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Sun Nov 15 10:15:12 2026 -1000"
  },
  "message": "cgroup/cpuset: Don\u0027t revive invalid partition without active CPU on hotplug\n\nWhen a CPU hotplug leaves no CPU outside of the partitions for the top\ncpuset, cpuset_handle_hotplug() clears subpartitions_cpus and gives all\nthe active CPUs back to the top cpuset. cpuset_hotplug_update_tasks()\nthen walks the hierarchy and invalidates the partitions, as\nsubpartitions_cpus is empty.\n\nHowever, an invalid partition visited in the same walk may be revived\nif its effective_xcpus is not empty. tasks_nocpu_error() doesn\u0027t catch\nit when its CPUs are all offline but it has no task. Its CPUs are put\nback into subpartitions_cpus, and the valid partitions visited after it\nare no longer invalidated, as subpartitions_cpus is not empty any more.\nThe top cpuset is left with CPUs overlapping with these partitions.\n\nIt can be reproduced on a system with 8 CPUs:\n\n  # cd /sys/fs/cgroup\n  # echo +cpuset \u003e cgroup.subtree_control\n  # mkdir A1 B1\n  # echo 1 \u003e A1/cpuset.cpus\n  # echo 1 \u003e A1/cpuset.cpus.exclusive\n  # echo 0,2-7 \u003e B1/cpuset.cpus\n  # echo root \u003e B1/cpuset.cpus.partition\n  # echo root \u003e A1/cpuset.cpus.partition\n  # cat A1/cpuset.cpus.partition\n  root invalid (Parent unable to distribute cpu downstream)\n  # echo 0 \u003e /sys/devices/system/cpu/cpu1/online\n  # cat A1/cpuset.cpus.partition B1/cpuset.cpus.partition\n  root\n  root\n  # cat cpuset.cpus.effective\n  0,2-7\n\nA1 can\u0027t take CPU 1, the last CPU of the root cgroup which has tasks.\nWhen CPU 1 is offlined, A1 is revived without any active CPU, and B1\nstays valid while its CPUs are also in the effective CPUs of the root\ncgroup, which triggers\n\n  WARNING: kernel/cgroup/cpuset.c:919 at rebuild_sched_domains_locked\n\nOnly revive an invalid partition in hotplug if its effective_xcpus has\nan active CPU, the same as what is required to create a partition with\ntasks. With that, A1 and B1 are both invalidated in the above case.\n\nFixes: 0c7f293efc87 (\"cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2\")\nCc: stable@vger.kernel.org # v6.7+\nReported-by: Sashiko \u003csashiko-bot@kernel.org\u003e\nLink: https://sashiko.dev/#/patchset/20261114083124.1340140-1-ridong.chen%40linux.dev?part\u003d11\nSigned-off-by: Ridong Chen \u003cchenridong@xiaomi.com\u003e\nReviewed-by: Waiman Long \u003clongman@redhat.com\u003e\nSigned-off-by: Tejun Heo \u003ctj@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0be0d26c442b1dff4af987917540be86771e919f",
      "old_mode": 33188,
      "old_path": "kernel/cgroup/cpuset.c",
      "new_id": "db32d330cfbc295788553bd72b9344a413ef38cd",
      "new_mode": 33188,
      "new_path": "kernel/cgroup/cpuset.c"
    }
  ]
}
