From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796327930; b=y9riLOArYt6btl+1pVfC1BED+OT2DgValRnegX+L8j2xPb0ONuaOOUM77MMu+HWYS41C am8h5m/1QKj6CiTFUYtWxeOAb0qYQpRvkg96aHA5+PSbcJwP5XJZ2TbwarzuSgC6gb57N qwnIInkSu/BVuh38tmrrz/uQtVpnmCeQw6RFwaMbC8apEivR7rrt2VZEI39gMv8ygchf+ bJZGf8/9kh/GLMT4GIi0jEosvywdf4X4s+oBH0J3Cb+1qlFDfSa0TtkOOoF+tP8l9wd/B gWrx8ax6XVTNJTsJjp9OzruDXWWUrTaZbG67zARxqImbAm9gaW2PEwDxt9OIlva4OVg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327930; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=17W9zvL2rElJZvH7PZhoQRH7weyfHCbwHLdv06bncLU=; b=vrpbLOFx0V33Q7ppbgBfDOeLRh3wqCcbzgZArIQq/szvX1ilPDDkABZVzy2ZsQJXpGVq yGRrSNqzUYt8z4VptAQBsjGeDcuNSnhET36PX2TFqDDs9FRLDiNV784FZzBE71+9fiYNN HlkS4HOuAMhI2jokMVXkRp2S8WyycfDsxAH47WnaU77lZhS0WFNh2Iwqz0qxC5CBkbNop +trBIXmHaPkDr7bbEcuRj6l1pNvsRsY4WmCLoJlT2L3FToGZ3WpT3yOFB4cGaGQaHgwck tk4sgK3E2N0ASmaJKQMGQrAqAlZTX8svFjHjyvxTO4T0xv/AdyZzqfTluR3mz3R8USw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yRIcGby2; arc=none smtp.remote-ip=74.125.82.47 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD7C5606A33C for ; Thu, 3 Dec 2026 19:58:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BD7C5606A33C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yRIcGby2 Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-1a2761c69fbso442341c88.0 for ; Thu, 03 Dec 2026 11:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796327929; x=1796932729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=17W9zvL2rElJZvH7PZhoQRH7weyfHCbwHLdv06bncLU=; b=yRIcGby2IzqK6k3H8nNUojlEAkaZRxOAFGOFtXMCKn/pYql0H3D8t8aknlq6tp7ROR fmkabgqM7jTO+Imx1dm0kjQye+E0o6oR18o38rSWfkuXQP9Qp8RnLUEfGo6UMCAwAPWH KfYZTV7YYA5CSHpTxvgQl9dU5znrQ7RHlD3521V1Fnr0pXOesgwazgjv26dBsEXVYkgJ lMI5M0TkHzljPm6uNAmQlAVS8uYnX8TjuEbFzVdg7/VedXKyOMh/k5Gp8W9NkHAW7Rox wG7rXnD+/eaDbsPAU5f+IsuRRA1yoLuB/GT+TBrjFWvlmo6MyZinLKzQYZpextl00+Mk YMAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796327929; x=1796932729; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=17W9zvL2rElJZvH7PZhoQRH7weyfHCbwHLdv06bncLU=; b=yXu6rFUhtM001xPsC/St54M6a3/9qi5IYJuUsLyENlJKl+wLl7nwpN1emN0l8QGr2B fJTMt3fc1ZL6hz7oPp86oedl5X/A8Ngiy2o5pxPgbYlONuciF9OCZI1jZ7jjnn8+B5DD ie8OHEqhNaHGXiGZoVpWdq9yvrCdnkhio4o5jcNeXbWBLbTnn+VZMOzDLhO4/K4RlcBz 5icOI7NJ/0EVMtgNaUsodZ4Z3My/biM3965gAtLS1xyoPI9qiUicsUbtnX81exgp/DRP AGhu7Nl86ZHJHo6dvdtU4LM2wk8uianqD9ioeHeugPtRsFV8KS3gRousBqnyMGEdpAZl bjRw== X-Forwarded-Encrypted: i=1; AL+hErEM77LEXaN/wCLJdeqA+OVloWDDAu/e0aap00EkOSdGELbD38q2K/7jY63Q4fXxjVFvveHv1CWnxPBudhI=@vger.kernel.org X-Gm-Message-State: APuU4Z/OsmQrvte5TWGjKXASkSi1oK86rQszuGMMS9Axdn2VlPMPr5Tj IuUIpQ4zj7J87FC6ezI9rARVS4mWfZlECVrdLXR/MJNfFj6SL6wOA5ky X-Gm-Gg: AZFdTZe2j1L+QSrA5ath3q5Y5wE5K1fyofXEpan3mG4L4Bx0mB2B9SliCZ8lqZLQ0pM jDwlZib2y4dLst+IAlueb8h+rDzGM9YegRbxb3DEE3qPOTofXUjG0UpsaQDOSxaDTxt7lMn+l5h yh2IRS3h5TFIIAu15lmEEeLbrOhWcLrNUGtgbpKEsmuWzIX9rtsAk5b9dCvQydVf4EFjNJXMT2Z elSRu2vXgGI96mukE5YoWJ70jQR8TGAUPCnVqxdNsuddt83HN5ajmoTZEwmiMd12KvYVc0xAv4v 5Bk8iGFj+Gad01E6yFzFS5NMe3A58cI5eb7lyQBkiWZhQdlzHCIVc/oORMftgnXceladRHY9k7I TVxaBjMp6atjWFoIYwiCRSUOUmshhFIYzcqu0G9PeenNdvGEZ5jP1vemLWUupDaew71tztpWmRZ ddi3lgf9UMvKo/qqXFCPxmpZRI/cr8mKg+ohMozn1uik++PGWY8uc9/CePbqgWGLbTG/TU1AS0w 2CZ3kHdK5SHoqmzniPcoX0ALusJQtzaph0VmF4GHGQ94x23ILNpHyWeuP39TFY95Nw0GbH3Cm7S P0g3FMTzXhjQ9CE7EQ4Y0J3Sz4m8YvUqUNKcaAd349J/+VUel7tayTUVX8BoItK3Hg== X-Received: by 2002:a05:701b:465f:10b0:1b2:48db:23dd with SMTP id a92af1059eb24-1b5568cfbcdmr44381880c88.16.1796327928482; Thu, 03 Dec 2026 11:58:48 -0800 (PST) Received: from 6610b1a2ef46 ([203.116.140.24]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d6455949sm327613c88.9.2026.12.03.11.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 11:58:48 -0800 (PST) From: Hang Zhengyang To: Waiman Long , Ridong Chen , Tejun Heo Cc: Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Shuah Khan , cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] cgroup/cpuset: Fix partition switch after a sibling releases CPUs Date: Thu, 3 Dec 2026 19:58:41 +0000 Message-ID: <20261203195843.187930-1-hang.zhengyang1010@gmail.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since commit 2a3602030d80 ("cgroup/cpuset: Don't invalidate sibling partitions on cpuset.cpus conflict"), a partition without cpuset.cpus.exclusive whose cpuset.cpus overlap the exclusive CPUs of a sibling gets only the other CPUs. When the sibling releases them, the partition keeps its CPUs until they are recomputed. A switch between root and isolated recomputes them and takes the released CPUs without taking them from the parent, so the CPUs end up in two partitions. Patch 1 fixes the switch for local and remote partitions. Patch 2 adds tests. CPU hotplug recomputes them the same way, so offlining a CPU after the sibling released its CPUs also leads to overlapping partitions. Chen Ridong's v6 "cpuset: rework local partition logic" and Waiman Long's v4 "More fix patches" both change that path, so I left it alone. The switch problem reproduces with either series applied. Another way to fix both would be to update valid sibling partitions when a cpuset releases exclusive CPUs. I can do that instead, or rebase on the rework, if you prefer. The series is based on cgroup/for-7.4-fixes and also applies to cgroup/for-next. Testing: - Reproduced on v7.0, v7.4-rc5 and next-20261202, not on v6.18 or on the parent of 2a3602030d80. - With the series, test_cpuset_prs.sh passes on cgroup/for-7.4-fixes and next-20261202 with 8 CPUs, and on next-20261202 with 12 CPUs and isolcpus=10-11. Without patch 1, the new cases fail. I used Claude Code to find the issue, write the patches and run the tests. I reviewed the patches. Hang Zhengyang (2): cgroup/cpuset: Update the parent when a partition switch adds CPUs selftests/cgroup: Test partition switches after a sibling releases CPUs kernel/cgroup/cpuset.c | 41 ++++++++++++++----- .../selftests/cgroup/test_cpuset_prs.sh | 14 +++++++ 2 files changed, 45 insertions(+), 10 deletions(-) base-commit: 05afa0c55015b3c7f3c2136dde7fbcfe5195b21f -- 2.53.0