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=1796223273; b=gu6mkJsDErE4KrYDceql9FTpf6vEPNh2Lr/K2iFqVzc3DfzSkUZw0uoqn+vsYWPkJ2Z9 GOokYMJwhQ9zmhBAWJOKf+ajFpINV0hYsXi6ni+ZP0qLJtTM+kEO5EUkwX3fwnjjzrKOI AWNBKtGPjBFEUpvuW/+NV4yC8jFcUlGlrI946cl9rwAmh+LxgpreZdMBHD0cHH0W5NM6Q 6tl6X2skcOV9OqrTPPa9GU61lzPe+j5Q9J9p0sv8Wte5i32eqDoDYeOm8jRyfyhfHr/Rf zkhZWg3YvqSovULt/eK0/13tNApvuQGaGpzYTO9xmDLpi9mskB437ggaAR+BDsxuI2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796223273; 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=NY1YGiK17OXUS6E4wmmIP26yS5vShMwuEcSgqqL6UcE=; b=ViR/zPctUnw+i9Hxbswwbz4UpCzJTsn2FnM5rEiwz8UcE05QeUY0HasZNhhtTfEb0IQD K88z0ZhyRbBGDN8ix/UGqN44mMqm/Ekp2gcxVeaMfUE+RpMUiZn6MF3p+hsiUGAS5Zq/p sS0UPJ3MyKtpcOON4bgKVgCx83FpUNo8VI9i3IlPJD5WsxLCA2ocX5AU5xmWkGWKMhpYO OcPeDYzLCqHH4powQg8EBrcNWRW4xVW0Plh496HD61VXQbwOkliRDveptGk1Wx4FsrAL3 a1ak0S8HB9JletZU3vsEDjUCDn9IGCbLegu3ONnQ2IjW5u94eqgOd0R7vgbB/KZe89Q== 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=D20oZDqo; 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 CF741606A69D; Wed, 2 Dec 2026 14:54:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CF741606A69D 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=D20oZDqo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1796223271; bh=NY1YGiK17OXUS6E4wmmIP26yS5vShMwuEcSgqqL6UcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D20oZDqoV4dpxYBBvEe/5aMCqZF3pECVK5q7wrfdpYfyQEYiUke/YMHadkmTlyINv C8TF2Bs5O30ZhfhsOgfytyAtOdLHc3RqZVrw5204YUQzix2Mf3fU7YM/r0oP9rAIBy +N5maxjpWmN1Ay5obJcxRE5151B+LFymURHof5OUO3K7Kr+iqp+0pMuK7T1JsPg5xX WNDyi8rAk5bM9omTwOey9m5HS9sNzl8eeeADWrUGKFViCiNf2faEB6ZkIEyWQV+tDe mljJ3t72JIr1Ap0nf4jtp1gNZF7VJ1cFKQmhySYsmr8rTIcbrHeCrjKcTCC+w4LjSs fPovb7lCsPGXg== Received: from thinkos.internal.efficios.com (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4jfglC04KRzZQY; Wed, 02 Dec 2026 09:54:31 -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 33/36] sched/deadline: Keep a reaped deadline task in a rebuild Date: Wed, 2 Dec 2026 09:54:26 -0500 Message-ID: <20261202145428.341797-9-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: <3edb25262589e32cd881312999f521f9bab9d910.1796146461.git.mathieu.desnoyers@efficios.com> X-Mailing-List: linux-rt-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > Can the lockless check of p->dl.dl_bw race with __sched_setscheduler() > admitting p to SCHED_DEADLINE? Yes. In v14, dl_task_unhash() will test dl_bw under the rq lock. release_task() will then take the rq lock of each task it reaps. > If p migrates to another active CPU in the same root domain between > release_task() and its final schedule in do_task_dead(), does > dl_task_depart() leave a stale p->dl.dl_bw_cpu? Yes. In v14, dl_task_depart() will record the CPU the task departs from, even for a task already on the list. Also, if the CPU recorded is inactive, dl_clear_root_domains() will no longer drop a task that still runs in the class. It will count it on the CPU that the walk of the task list would pick. It reads the task without its locks, so that CPU can be wrong. The bandwidth then stays in that root domain until the release, or the next rebuild. > Can keeping an active exited task on dl_departed_list cause a rebuild to > drop its bandwidth while it is still running in SCHED_DEADLINE? Yes, for both cases. The second fix above covers the second case. For the first case, dl_task_undepart() in v14 will set dl_bw_skip_gen. That asks dl_clear_root_domains(), which ends the rebuild, to count the task. Thanks, Mathieu