From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=158.69.130.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796223272; b=hzKMcXpYQHjzf7Rbh0516VxI7fFxLiVa2R8BfSOkIzj8WLrsE7XEIL7GcpYzoRcfeFCq mYmzNtKuTcYbkwQ1f6diD0tCTo/blnzni3s4afH6pLGyEtU+YLsGQ7o4YBNpWChaL8rbQ bsOupFFNT0u7VXG98/kJyCE4qXOe6foFixax5km9sD5/bdQ36FpeRsZrOEwsY+jOdYt6P KazvvB37C1AkDHmzo/SujteyEbWubk8WYSgyxeqBv3BuBQthXjM2L2RloufOOudrye3IE BVE2XuC5DzGtKQH36nobQdxmqHDgzgxP6PDNn9XlNiZ9jSb1fzj4ZfJyygQK6O5EvuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796223272; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=xNhQjcbLdqytTKmlQUvyl6oj0jV2Q6oUe3GuyYhzpck=; b=jZxodsRGWXabAqX1aVbMbbD9rnd61v5FJuiwtigUknlJAIa8ibyp6vFCW2csgS2k88UM Hl94QoTHJLgIpygYWXyuJ7cyFt2uKFEh8C0H5dQseva54YrUU9XVt83IZ+f1Dfrn7bxcV waKngQz4Ztfh5fYtGMiVVYR2rDqwZVJHS7XV71y3UtyoAHRcNrNfdeELfKAMnYPBDe0a+ VFeAWgJsd2YZvxwjQ2vdy/uHsP2t8fF/nPStfBVMEjBex8YN6kz/FDoDumGdvZ9eQDdmP wWJp3wgG6eFjLgibfMOzftxkanzW+KJwqANMhAwTNXBoikZrgllGnU3PLJsiueuDfQA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=smtpout1 header.b="udgRU/zH"; arc=none smtp.remote-ip=158.69.130.18 Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A314606A32E for ; Wed, 2 Dec 2026 14:54:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4A314606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=smtpout1 header.b=udgRU/zH DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1796223270; bh=xNhQjcbLdqytTKmlQUvyl6oj0jV2Q6oUe3GuyYhzpck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udgRU/zHD0aKA+nNJ8V43NGm6hqJfaqzAJgmUN04zrIW5w8qjLX1eeaWmBjjXI2m6 qe0bv4Ac/KTVr9Hq68D8Dyjy1FzlNH1tiPsQUq7vmjDdD4efTQ9m81yt5JFRie33Qk qwFLJW6w4ykow6h/RksrX0870QytPChaNVG4t5nlHQ5vfAQTmUMkEnS+3YjOgSV0NM RQnB+cdCr+htdXfYYyFI3i0zZRasSkk5538kGBQohhNfUtV2vUwgR/4e8CL/dQ1JC4 RA/aaAcoVuB55ivd9cd/cqf3ORX00kzwx+VoC6bYuotFFroKgJ1lf2Ukk2W4R6cvCk K4OCeeFRNm3yw== Received: from thinkos.internal.efficios.com (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4jfglB3p2mzYhV; Wed, 02 Dec 2026 09:54:30 -0500 (EST) From: Mathieu Desnoyers To: sashiko-reviews@lists.linux.dev Cc: Mathieu Desnoyers , linux-rt-devel@lists.linux.dev, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 22/36] cgroup/cpuset: Refuse to take a deadline task out of its root domain Date: Wed, 2 Dec 2026 09:54:22 -0500 Message-ID: <20261202145428.341797-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: <1539531b02f82ae36ef7547965cbef9acefbdf4f.1796146461.git.mathieu.desnoyers@efficios.com> 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 > Could dl_tasks_hold_bw() be checked on entry to dl_tasks_keep_without() > and dl_tasks_keep_root_domain() instead of only inside > dl_tasks_keep_cpus()? Because cpuset_mutex prevents any task from > acquiring deadline bandwidth during the check, testing it only at the leaf > causes every cpuset mask and partition update to walk all descendant > cpusets and recompute effective_cpus_below() even when no task in the > system holds deadline bandwidth. It could, but the gain is small. dl_tasks_keep_cpus() already calls dl_tasks_hold_bw() first. So with no deadline bandwidth held, the walk of the tasks does not run. Only the walk of the cpusets stays. It runs only when the cpusets change: on a write to a cpuset, or when a CPU hotplug makes a partition valid again. update_cpumasks_hier() walks the same cpusets on a write. The v12 review asked the same. v14 will leave it as it is. > When cpumask_equal(cp->effective_cpus, new_cpus) is true here, in the > second loop below, and in dl_tasks_keep_root_domain(), should the loop > advance pos_css = css_rightmost_descendant(pos_css) before continuing? > Since valid child partitions are already skipped and non-partition > descendants derive their effective_cpus only from their parent's > effective_cpus and their own unchanged cpus_allowed, no descendant in cp's > subtree can change effective_cpus, yet a plain continue walks every > descendant in unaffected subtrees and runs effective_cpus_below() on each > of them. The same answer as above. The extra cost is a walk of the cpusets, and only when the cpusets change. v14 will leave it as it is. > When an update to a valid PRS_ISOLATED partition invalidates it, can > returning all of cs->effective_xcpus to a non-isolated parent move a > deadline task out of the default root domain without being caught by > dl_tasks_keep_given_back()? Yes. In v14, such a write will fail with EBUSY if a deadline task in the partition would then change root domain. To know whether the write makes the partition invalid, the check will repeat the tests of partition_cpus_change(). A new case, partition_invalidate_refused, will test it. > Can shrinking a partition still move a deadline task in the parent's > hierarchy out of its root domain in cases that dl_tasks_keep_given_back() > skips? Yes. In v14, a write to cpuset.cpus or cpuset.cpus.exclusive will fail with EBUSY if a deadline task would then leave its root domain. The check will cover these writes: - A write that only gives CPUs back. It will check the tasks of the parent (paths 1 and 2). - A write that takes away all the CPUs of a partition root below. It will check the tasks of that partition (path 3). A write that only shrinks a partition root below is not checked. The tasks of that partition keep the CPUs left to it. New cases will test the refusals: partition_shrink_moves_refused, partition_shrink_isolated_moves_refused and partition_child_invalidate_refused. Thanks, Mathieu