From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A5933672A0 for ; Fri, 10 Jul 2026 03:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783654132; cv=none; b=kjeIZLSIcNLSx7cRFKigWS0vmALHQFqzXSRCrJ3/waY5vlcA/YC9PZu6zJnICY7sVD4TZ7uQUNgRcSNKrkvCWYUpTFhC/kY4B59ZAni0ZD2nMERkocXVrFUCaDYyERuSqcOUxV0BwYBDxpIflsl275YZ/GLmC4rJ9EJG/HqhpkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783654132; c=relaxed/simple; bh=DSH1dsD7ufyJUSitPhujJbKPkynswivD0Ay115xuL8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ovWF/IuKyN3kD+2nwrEBqcADGHbkfvHXObBSLsj3du5DdHgAuEokTSIeffYnJF1iSsltB0X6nEURXH8kSwc0xlofkQWOpkNB5hGJMgTPK8s+Cs39cDOAJ34hwmV16M8aahdVbHpJSVw9cBPrw2EcNxpY4Hh0v6uJqduDsxj7/Xk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TOqZeRep; arc=none smtp.client-ip=209.85.214.173 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.b="TOqZeRep" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2caced6038eso5709865ad.0 for ; Thu, 09 Jul 2026 20:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783654130; x=1784258930; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8OHQR36SH5DHkwv4ahYjdM9a+G5jG41FdFMZ2BcZsNM=; b=TOqZeRep6oegsbqogMXnoxA1Rl9xdeE5wTH4F3P1nrrQZoy03wVa7K5pG04W8Je6N6 iYxhrF4ccDJjIVym2aNTT6Pf4ElV2wq6jDKLnoVG5X49+Y5/+e9WeRxIG5KjHM7UM+S7 pNa9ryubNJodOkwUmNDEbOYJl+JOnZznJAPznk9MmvXxk+1E/YUfxSJ1+teWOatFBujw U4DyC85XyO0CgHkS1GO8DQHlxXOkmAHNIpHbqEu4ZnxFBgE2eF3cipGp4QbWKlA/EW7k KIwSgYtL2cP9/itQ/izW2ZTrJ0hZph4+HRXDuXMwc6EmBhj6V4wX6QzHzyGLvoX2gEdf kpqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783654130; x=1784258930; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8OHQR36SH5DHkwv4ahYjdM9a+G5jG41FdFMZ2BcZsNM=; b=BIULMBtyOW9S1w+Xv6RpnX/Ya2Ji7DJnHb/1e9d1XKAVuiyKrUC0zsNpA4RMbwQUje eGMUYzmY4lZ4iP1gAeactVD2pP1cJbdKYRhv2UQUgdKkf1syyIVEbNGmTxEw7gIyZHrr ElWxBergBYN3UbPpm6ODL6wMi7gV+2D8qKxk7Jn7BMhOh7D2kkSAMkh36eicEUzVX0ID Bhya8eSqbv9bz9O1jQI2kKorAzbpsz677kNqgIcBPd5cs6veneQKgh1fLZZ8rkLHlNIc 4qRkGecim4lnP5wK8jkgVF9b2RRmeqJ9LNeKnnawCDQyeE7ZfOGODviYCKS7OWDVfuYJ K0sg== X-Forwarded-Encrypted: i=1; AHgh+Rq0SVfH6yUEIUMcIZ9BggW8vJqjlJcPoae2FnBY2FS1bYS/NrPFXqxc2THn6BpOghhZtHnHhItEGogeI14=@vger.kernel.org X-Gm-Message-State: AOJu0Ywg/8sTcRAz+yj4EUGnw9NIdp5tlAMYLlmDLTARNmTgTtBsCwpp 5GixF7gzhsomo3nScl6TD1cu5t8wNSkVVeAyQ2HKpeiBlvhmu1zOSRBw X-Gm-Gg: AfdE7cm2HtyZUyqKrgMNtPsRzlmgk4kriyUUWmiKHfpuo857DoX0ybVYGuKxnLhbGL8 MIxG2Rx273zguoUZ8luz+M17rzEArtuGxIPz4qo3I6J6J9g8R11oB8rHdAvJr1CoxMtfNkOuhw4 fHEOtHTunhyKG5/53hQYTLd+K0L0wrj6sI5hoO5TBywFfRSGZElnKYwW/hrtBKlip4Es+bGMtWx Uo0+bqFRB6fKSbi3DatzirDcAo2UI7u0wDthRQq8Ufo+h6qFB1vOxjRD5wpB7gq46Jr/a1osjza oGW/PROUiB3953lggr8FxeEi8IK85W5erIRL+oBS1CTaWf8fu7OgO0kam9UTR8q3r/uc0fsfBJ6 7Er2yaRnc6TDrNzpGWvvkKvxmfwlh4xpQAOXDBT3gBVfQcBn8kzgtONTb8rBLaDK7XIXgqlWu0k OJ5elAutJi0Zs= X-Received: by 2002:a17:902:d2c7:b0:2c9:994c:9a5 with SMTP id d9443c01a7336-2ce8298a501mr18775855ad.30.1783654129682; Thu, 09 Jul 2026 20:28:49 -0700 (PDT) Received: from [127.0.1.1] ([138.199.21.246]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9bdb56fsm53436465ad.15.2026.07.09.20.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 20:28:49 -0700 (PDT) From: Jing Wu Date: Fri, 10 Jul 2026 11:28:14 +0800 Subject: [PATCH v4 03/11] cgroup/cpuset: Drive kernel-noise housekeeping updates from isolated partitions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260710-wujing-dhm-v4-3-2e912e5d9645@gmail.com> References: <20260710-wujing-dhm-v4-0-2e912e5d9645@gmail.com> In-Reply-To: <20260710-wujing-dhm-v4-0-2e912e5d9645@gmail.com> To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Anna-Maria Behnsen , Tejun Heo , Jonathan Corbet , Shuah Khan , Shuah Khan , Thomas Gleixner Cc: Waiman Long , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Jing Wu , Qiliang Yuan X-Mailer: b4 0.13.0 An isolated cpuset partition already updates the HK_TYPE_DOMAIN housekeeping mask. Extend it to also update the kernel-noise masks (HK_TYPE_KERNEL_NOISE and HK_TYPE_MANAGED_IRQ) so that creating or destroying an isolated partition reconfigures the full set of housekeeping cpumasks. The sched domain mask is updated first because the workqueue flush and timer migration paths depend on it; the kernel-noise masks are updated afterwards via housekeeping_update_types(). housekeeping_update() and housekeeping_update_types() are called after dropping cpus_read_lock and cpuset_mutex, with only cpuset_top_mutex held for mutual exclusion. Co-developed-by: Qiliang Yuan Signed-off-by: Qiliang Yuan Signed-off-by: Jing Wu --- kernel/cgroup/cpuset.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 5c33ab20cc208..80f43a24d3c8a 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1347,17 +1347,36 @@ static void cpuset_update_sd_hk_unlock(void) rebuild_sched_domains_locked(); if (update_housekeeping) { + static const unsigned long noise_types = + BIT(HK_TYPE_KERNEL_NOISE) | BIT(HK_TYPE_MANAGED_IRQ); + update_housekeeping = false; cpumask_copy(isolated_hk_cpus, isolated_cpus); + mutex_unlock(&cpuset_mutex); + cpus_read_unlock(); + /* * housekeeping_update() is now called without holding * cpus_read_lock and cpuset_mutex. Only cpuset_top_mutex * is still being held for mutual exclusion. */ - mutex_unlock(&cpuset_mutex); - cpus_read_unlock(); + + /* + * Update the sched domain mask first; it must succeed + * before the kernel-noise types because workqueue flush + * and timer migration depend on the sched domain mask. + */ WARN_ON_ONCE(housekeeping_update(isolated_hk_cpus)); + + /* + * Update the kernel-noise housekeeping masks + * (HK_TYPE_KERNEL_NOISE and HK_TYPE_MANAGED_IRQ). The tick, + * RCU and managed-interrupt state is reconfigured as the + * affected CPUs are cycled through the CPU hotplug machinery. + */ + WARN_ON_ONCE(housekeeping_update_types(noise_types, + isolated_hk_cpus)); mutex_unlock(&cpuset_top_mutex); } else { cpuset_full_unlock(); -- 2.43.0