From nobody Thu Apr 2 09:34:31 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 15EE02F7AB0 for ; Sat, 21 Feb 2026 18:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771700109; cv=none; b=rE8cBAcSqY2IzU022IRGn+m0kW2UeGAqrVGEhKoCMtzQeRHto+ChjfOAWPsaMNohi1US3n79QXPjmmLsSyDX9SgqSuwPz53ra2PMNn4emxzH6X3ISkmMr5JXcmzbBbcBzYCNd+2cUfz5951QsfwanGGxBjrZHaaSSEa+odke+CE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771700109; c=relaxed/simple; bh=3/mMWO/OLnn9oAQq9BtmSdQudV3VYbGTs9aKl2ZAVQM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X29VqMyOZ105klhcQ2IipigO0Bvt2i9Dw7hO9GnD/LfMls+YQBI+9VARFM/tCgSBxbC9mEp0Y0C7eRjV0sB2Vg6JrN3WbqzY2qrbLMgdIgKOMXqlXkNBxNUn1LYMQcoyhz/tLUP0KGbjIWSW9M1WnGQqFGcGJfE/FU0RQB9IqqI= 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=ERty8GDZ; arc=none smtp.client-ip=170.10.133.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="ERty8GDZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771700106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dnRXsnkA10h3F4dXZbAzjijGxS97Xcwkc9wwb0raH3g=; b=ERty8GDZBhSP1bd2PIA/DKzj/uLANdzfjnq119IjsKQzxO9D6SbjkfXjwn+Vmoa24qIDCt RgTdDIRu+Q+1HeplHHYsc/V8F+WYV/UMqD5jDpKzgyOOiuZQ20Rr0CqgBstLt4rjBsu+70 lctIDTy9eZNZInEmx8M+av9yx+QS0nE= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-576-oT5MGJmXM_uYAVmrqn1PCQ-1; Sat, 21 Feb 2026 13:55:03 -0500 X-MC-Unique: oT5MGJmXM_uYAVmrqn1PCQ-1 X-Mimecast-MFC-AGG-ID: oT5MGJmXM_uYAVmrqn1PCQ_1771700101 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5D44F195608E; Sat, 21 Feb 2026 18:55:01 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.2.16.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BFD241955F22; Sat, 21 Feb 2026 18:54:56 +0000 (UTC) From: Waiman Long To: Chen Ridong , Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Frederic Weisbecker , Thomas Gleixner , Shuah Khan Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Waiman Long Subject: [PATCH v6 4/8] cgroup/cpuset: Set isolated_cpus_updating only if isolated_cpus is changed Date: Sat, 21 Feb 2026 13:54:14 -0500 Message-ID: <20260221185418.29319-5-longman@redhat.com> In-Reply-To: <20260221185418.29319-1-longman@redhat.com> References: <20260221185418.29319-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" As cpuset is updating HK_TYPE_DOMAIN housekeeping mask when there is a change in the set of isolated CPUs, making this change is now more costly than before. Right now, the isolated_cpus_updating flag can be set even if there is no real change in isolated_cpus. Put in additional checks to make sure that isolated_cpus_updating is set only if there is a real change in isolated_cpus. Reviewed-by: Chen Ridong Signed-off-by: Waiman Long Reviewed-by: Frederic Weisbecker --- kernel/cgroup/cpuset.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index e8c0b3cfd1f9..05adf6697030 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1179,11 +1179,15 @@ static void isolated_cpus_update(int old_prs, int n= ew_prs, struct cpumask *xcpus WARN_ON_ONCE(old_prs =3D=3D new_prs); lockdep_assert_held(&callback_lock); lockdep_assert_held(&cpuset_mutex); - if (new_prs =3D=3D PRS_ISOLATED) + if (new_prs =3D=3D PRS_ISOLATED) { + if (cpumask_subset(xcpus, isolated_cpus)) + return; cpumask_or(isolated_cpus, isolated_cpus, xcpus); - else + } else { + if (!cpumask_intersects(xcpus, isolated_cpus)) + return; cpumask_andnot(isolated_cpus, isolated_cpus, xcpus); - + } isolated_cpus_updating =3D true; } =20 --=20 2.53.0