From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C9B53FFD for ; Sat, 21 Feb 2026 19:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771701523; cv=none; b=Xw/vPbVFIXS+B/zr4pVecyYYcRcmp5K/FDugVxxkOKyOJRYHlH23pOTcsA08sN+QAePZ3BB/oJBaD9HKuEf5qmHp+hesyAYWazLMGVKIsCZsXwu5kKN28j1QpBqpO6U5kD7KcGXz8TmFrl7dmAFuQCbhraLt5UKu7hR9WagZucQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771701523; c=relaxed/simple; bh=y5yCMd2oa+DT/yk9AJ3rCQZW9RGjNj8Gsp2vP1DzXQI=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=WaO/n1yN+9y3W+xOmTm5ZejO+hijmKcXffbeCoJJm5vLE9gHAmFwPLgxoxguLAHgnfw/VNGZWqdH92IPD8rsstqVa99rrdeluqket1zkZwPPpSjsgkfgnRwRb4F0rw5aNleGxncx5Hkiod5ljPtI/gBWne76r14h/BTD+112c8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CURV2HjA; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=HML46KRi; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CURV2HjA"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="HML46KRi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771701520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hx8RfWzWYamghKcrDMA6FiyZYhfTQKUfitsZoNr3bPw=; b=CURV2HjAq1FtKUpE8coeNsnaUKfimSSebJISZwe6QZ98rcPh4vl/upOR3dpWw2KAw4ffya qRd95Hr6YBa0w7Z/Be6KvACYDqNJEN5LGCM9/v7cfwiqg58G7LJ4MSXd691P/YtqLAxZoF cn4iIEyorFyTTO2jCQHBVqz8LI1i9G4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-1EciSUwDN0O1zXsfswJgIQ-1; Sat, 21 Feb 2026 14:18:39 -0500 X-MC-Unique: 1EciSUwDN0O1zXsfswJgIQ-1 X-Mimecast-MFC-AGG-ID: 1EciSUwDN0O1zXsfswJgIQ_1771701519 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c711251ac5so2479256085a.1 for ; Sat, 21 Feb 2026 11:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771701519; x=1772306319; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=hx8RfWzWYamghKcrDMA6FiyZYhfTQKUfitsZoNr3bPw=; b=HML46KRiydpyEPTTIzyW96oRcppOA6yWAsGRIoVgPm7b3ZU4+whoXz8SKNqK6Q0LdB bm0wFzEFwUfOcLaAWbZsS1sOF/mpQcHItoD7evB/m9FoTiouK6SK8ZU3Ppstz6X6sq9h GULvvTcdjlZZQ1LRel+KWJPvhg7J9Rs3AiXpxqHuNOPQHA9JkcTyIgs6kkGO0+BTZy2Y 0ZYOYpDvq/Tv2RUIn2lvKqy5xM/BXNSDShPVBThpU1JhHANUXSV6X2SsXW1ziXHQjYZR qgfip+Jlr4uB2EQFcBexKgxI2MA9rgZT3xDOEyc16GgI0DW1jv2rUHEUiSlq5KdBQw2f YRnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771701519; x=1772306319; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hx8RfWzWYamghKcrDMA6FiyZYhfTQKUfitsZoNr3bPw=; b=UeSR3Nn8ccrmBMwqH9GnAVE+a/mANiLktsae40yiKYaBwBdxw7rqiFbPY8U/RA/Hjf 0gexWzlIaaHigMVx+GDuBKrxpKONO+8d+/d4FU9FndEbFKtIfRj42mAwzFOYxVu2Dd/7 IqVQaAFt+HvVEQaG7X9kvSB1rIygcNEKPMd0x0rwYGSm/S4a9fzIcjRWho1CqM1QuE1W RZaq0E5Qg3ZJdiZCkIFR1vh2zql4ci1eBYaQrT9wo75IEPSc1W1XsHt4t6vMY/ved7eT 6htUh2H17SbFEc7Y1Qk/hzRJfNSJ+gB3+4vkbOu8g2Gskr48Xw1uB/UrFzzUj9aSINh3 IjUw== X-Forwarded-Encrypted: i=1; AJvYcCWNIq9gB42v5d9pR5XQF1rdRFCcNs/vglU0b/IhSHS+ommpE9nqtEdSOD1LK4N57sIR2meOkT0PIBQevy4=@vger.kernel.org X-Gm-Message-State: AOJu0YxDYXPP5mvKcDXGbpWreFKVaQ4NgB/qMb7zpToxH6HIkhpxJVrj GRtHsx/vlfTPU16C+/RYgPSHK+5oT/21LH6PX7MOHgUCGEz3gkk7A0+u5+sxwDK1BzuZYQkouwk 5I0HB4P7KI/GDpA1etSgjrHSLyfebluI7SH6Rqtb6lUQrLj3++RUGsflQNVpgo967Yg== X-Gm-Gg: AZuq6aKmR/wxkHIEpcC2g4ohSQ6HZBgFhLcBX/UNKA81+PNRhOwBe+SEf+sTluzJeLe o7sYB0QE84ByjMPWGZyoY5fzgsSJK05mrmsHyFv9yR6/kBjNiuPQZlNXtKosGA1dY0czMM51/dS 9mf8OingEA5Pss96pI1LNHcgzEyqF588XajcFAx6MHkk4LSHj9Z3bDmRHXurcG/gaHxvTz7qrjM nRiR4BWSSvH93DayzB5FI7IBd1U0HG1oGFxrku0Nbbelk7ktpFLZ2OvsUp6izLqX8H61ih6zUhM 6tfuc9KS01MgcmFvkYgX8icTMysdV0XGiHxf7f5WLDuKuGSZm4sJ7aS572t3lWkBSDemGbTDIA+ z3tGAUhvRMfsA3ttekkJYff0qEL5//VXzxvghLPC9QVM9ztQ+hgI5svD3YjBoLDdK+Nk/ X-Received: by 2002:a05:620a:708b:b0:8c3:7f27:a65d with SMTP id af79cd13be357-8cb8c9fd136mr483931885a.28.1771701518673; Sat, 21 Feb 2026 11:18:38 -0800 (PST) X-Received: by 2002:a05:620a:708b:b0:8c3:7f27:a65d with SMTP id af79cd13be357-8cb8c9fd136mr483929285a.28.1771701518176; Sat, 21 Feb 2026 11:18:38 -0800 (PST) Received: from ?IPV6:2601:600:947f:f020:85dc:d2b2:c5ee:e3c4? ([2601:600:947f:f020:85dc:d2b2:c5ee:e3c4]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cb8d0460c9sm287647285a.5.2026.02.21.11.18.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Feb 2026 11:18:37 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: <359310f9-216a-4f0b-8de5-02d9b0829b3e@redhat.com> Date: Sat, 21 Feb 2026 14:18:34 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 4/6] cgroup/cpuset: Don't update isolated_cpus from CPU hotplug To: Chen Ridong , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Shuah Khan Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260212164640.2408295-1-longman@redhat.com> <20260212164640.2408295-5-longman@redhat.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/13/26 1:56 AM, Chen Ridong wrote: > > On 2026/2/13 0:46, Waiman Long wrote: >> As any change to isolated_cpus is going to be propagated to the >> HK_TYPE_DOMAIN housekeeping cpumask, it can be problematic if >> housekeeping cpumasks are directly being modified from the CPU hotplug >> code path. This is especially the case if we are going to enable dynamic >> update to the nohz_full housekeeping cpumask (HK_TYPE_KERNEL_NOISE) >> in the near future with the help of CPU hotplug. >> >> Avoid these potential problems by changing the cpuset code to not >> updating isolated_cpus when calling from CPU hotplug. A new special >> PRS_INVALID_ISOLCPUS is added to indicate the current cpuset is an >> invalid partition but its effective_xcpus are still in isolated_cpus. >> This special state will be set if an isolated partition becomes invalid >> due to the shutdown of the last active CPU in that partition. We also >> need to keep the effective_xcpus even if exclusive_cpus isn't set. >> >> When changes are made to "cpuset.cpus", "cpuset.cpus.exclusive" or >> "cpuset.cpus.partition" of a PRS_INVALID_ISOLCPUS cpuset, its state >> will be reset back to PRS_INVALID_ISOLATED and its effective_xcpus will >> be removed from isolated_cpus before proceeding. >> >> As CPU hotplug will no longer update isolated_cpus, some of the test >> cases in test_cpuset_prs.h will have to be updated to match the new >> expected results. Some new test cases are also added to confirm that >> "cpuset.cpus.isolated" and HK_TYPE_DOMAIN housekeeping cpumask will >> both be updated. >> >> Signed-off-by: Waiman Long >> --- >> kernel/cgroup/cpuset.c | 85 ++++++++++++++++--- >> .../selftests/cgroup/test_cpuset_prs.sh | 21 +++-- >> 2 files changed, 87 insertions(+), 19 deletions(-) >> >> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c >> index c792380f9b60..48b7f275085b 100644 >> --- a/kernel/cgroup/cpuset.c >> +++ b/kernel/cgroup/cpuset.c >> @@ -159,6 +159,8 @@ static bool force_sd_rebuild; /* RWCS */ >> * 2 - partition root without load balancing (isolated) >> * -1 - invalid partition root >> * -2 - invalid isolated partition root >> + * -3 - invalid isolated partition root but with effective xcpus still >> + * in isolated_cpus (set from CPU hotplug side) >> * >> * There are 2 types of partitions - local or remote. Local partitions are >> * those whose parents are partition root themselves. Setting of >> @@ -187,6 +189,7 @@ static bool force_sd_rebuild; /* RWCS */ >> #define PRS_ISOLATED 2 >> #define PRS_INVALID_ROOT -1 >> #define PRS_INVALID_ISOLATED -2 >> +#define PRS_INVALID_ISOLCPUS -3 /* Effective xcpus still in isolated_cpus */ >> > How about adding a helper? > > bool hotplug_invalidate_isolate(struct cpuset *cs) > { > if (current->flags & PF_KTHREAD) && > (cs->partition_root_state == PRS_INVALID_ISOLATED); > } > I decided to revert back to the v4 way of deferring housekeeping_update() call to a workqueue to make it simple, but do it in a simple and straight forward way. Thanks, Longman