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=1796141948; b=CjSVE30XuaEWDE4Vq4l0Wee5V5zHMIyzEHd+otqGohaCmF0M6vuRCzto6B1GopDjbjch LAGCh9MPrN6IBjAUgwI3HtpDTW/Ea8MmyTRvaItxw6Qip5h8Vfg/v4jx9tnA29bH9YeTi dTTGusVpZ5RQGjQWf+vsmo+oTxSMT2CKEWywtYVjZ5b6pDeEPGOMpOwQeOK9pibOXbPga WUhOCvRicYVKVDqsdKiocRdGDzLcrmC4ZJQSW6smgtaqBo85NtltzW7YAUSQEAGlE6scf NjlKEYscqRAMfygZm7g2rlWyxMRUBQCpKQHjdRR5edYuwzenbHPpVmJouIrJTaDznpQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796141948; 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=41wzRW7UgVbVs7yPIDa0l/s359pvD8wbKnbyg8Wi448=; b=V0EeZ3Wpz8+NFc98wRmg/KBfbYdwMhj9rt+aFnao9mXu/+xBR1tZ7YQST2kq/uiLXyWc /KhJJ5BBZTqtX+ixOR6F3XFB4maQyB9YcS3CP3GbkOIpJaiE5KU+UI8RFiWLlVKnuAU1+ jgFVorBz1T/QOprsiNKXRy32ThLx3QoWzdH7D/+cC9YQWhXy+1HhIfz22BY4K1LI6ZC6F dLFIYOX1Cqxlz4UlYzE+NjVgYfJVkpEM0QixgxdBc6FLM2Ndmft6cXjnQ2VRjpT8PQj3q woKjuWxBV7I+pPNlJ0oscMIn4qKiIMgQ4WVerBuBpvx3E+GrYBZus/+SR9EUjIxDr+Q== 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=v2Z5Bx1Y; 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 2FB73606A6BD for ; Tue, 1 Dec 2026 16:19:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2FB73606A6BD 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=v2Z5Bx1Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1796141940; bh=41wzRW7UgVbVs7yPIDa0l/s359pvD8wbKnbyg8Wi448=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v2Z5Bx1YtcBHp11pFDLHJ/Zz6FP0ZJfrK89Pcnjl7pf3VXlTwWEjoeuRMvrAx5dTo XBtf5EeL2ibJwwkALWjPPKVPbdnS/32zOXZukkJPRk84BSijM0zw7NxhDGzoU0l7fM MjHGSMumZROQJHPcLgLA4wDl/wn3CC7bot7lFmmdPyWuexKH2cejaT2AlqLkzhQOdD huF2eUVFTlDxF1Cu1Lbuy70fSzTmtrMaSjwX0z+uRRt59EtRhKPEAAGociY03+sTq0 6/It3a17HWkvPvaaiIRpuavC37E7RaGt9FrbHfP46SIkb+GvmlV0vA92T7A5FzVtdS k8aCqsUM5jzUA== Received: from thinkos.internal.efficios.com (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4jf5g86b3GzYy7; Tue, 01 Dec 2026 11:19:00 -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 v12 26/43] sched/deadline: Keep a departing constrained task until its next period Date: Tue, 1 Dec 2026 11:18:51 -0500 Message-ID: <20261201161900.284450-6-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: <54e41332aec6ddeb1d060c892cbac401c936df86.1795771148.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 > Can a departing constrained task still release its bandwidth and lose its > deadline at the 0-lag time when task_non_contending() races with > inactive_task_timer()? Yes. In v13, the new flag dl_inactive_pending will tell whether inactive_task_timer() still has to act on the task. task_non_contending() sets it when it arms the timer. The handler clears it under the rq lock, before it returns HRTIMER_NORESTART. If the flag is set, task_non_contending() will leave a departing task to the handler. Otherwise, it will go on as if no timer were armed. > Does canceling the restarted inactive_timer only in task_non_contending() > miss a task that returns to SCHED_DEADLINE while inactive_task_timer() is > returning HRTIMER_RESTART? Yes. The timer then stays queued for the next period. This alone does no harm. When it fires, the handler finds dl_non_contending clear, and does nothing. Exit is the exception: see the next answer. In v12, the task can leave SCHED_DEADLINE again before the restarted timer fires. Then task_non_contending() releases its bandwidth at once. In v13, the restarting handler keeps dl_inactive_pending set, so task_non_contending() will leave the task to it. > Can that leftover restarted inactive_timer leak running_bw and this_bw on > the runqueue if it expires while the task is exiting in do_task_dead()? Yes. In v13, the handler will leave alone a deadline task whose dl_non_contending is clear, even a dying one. It will no longer clear the parameters of such a task. The last dequeue of the task then finds them, and removes its bandwidth. Thanks, Mathieu