mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Juri Lelli" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Weiheng Qiu <weihengqiuu@gmail.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/urgent] sched/deadline: Reject SCHED_DEADLINE on exited tasks
Date: Tue, 03 Nov 2026 13:25:58 -0000	[thread overview]
Message-ID: <179371235835.1009794.6060109721665812114.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20261103-b4-sched-dl-bw-fixes-v1-4-dd761fe005b4@redhat.com>

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     a2b67e904401858d9f0ff6a0485c2fab506cc1bf
Gitweb:        https://git.kernel.org/tip/a2b67e904401858d9f0ff6a0485c2fab506cc1bf
Author:        Juri Lelli <juri.lelli@redhat.com>
AuthorDate:    Tue, 03 Nov 2026 12:26:32 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 03 Nov 2026 14:18:06 +01:00

sched/deadline: Reject SCHED_DEADLINE on exited tasks

sched_setattr(SCHED_DEADLINE) on a zombie task succeeds and charges
total_bw via sched_dl_overflow(), but the task has already done its
final schedule() and will never run again. Nothing releases the reserved
bandwidth. Repeating this fills total_bw to the admission cap, after
which sched_setattr(SCHED_DEADLINE) and CPU offline fail with -EBUSY.

Reject sched_setattr(SCHED_DEADLINE) on exited tasks with -ESRCH.

Reported-by: Weiheng Qiu <weihengqiuu@gmail.com>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://patch.msgid.link/20261103-b4-sched-dl-bw-fixes-v1-4-dd761fe005b4@redhat.com
Closes: https://lore.kernel.org/all/3f6e6c87-645b-45fd-8fc6-8da5bc5b82d8@gmail.com/
---
 kernel/sched/syscalls.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
index be351f8..3fa447a 100644
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -584,6 +584,16 @@ recheck:
 		goto unlock;
 
 	/*
+	 * Reject SCHED_DEADLINE on exited tasks. A zombie will never be
+	 * scheduled again, so sched_dl_overflow() would charge total_bw
+	 * that nothing will ever release.
+	 */
+	if (dl_policy(policy) && p->exit_state) {
+		retval = -ESRCH;
+		goto unlock;
+	}
+
+	/*
 	 * If not changing anything there's no need to proceed further,
 	 * but store a possible modification of reset_on_fork.
 	 */

      reply	other threads:[~2026-11-03 13:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 11:26 [PATCH 0/4] sched/deadline: Fix assorted dl_bw accounting bugs Juri Lelli
2026-11-03 11:26 ` [PATCH 1/4] sched/deadline: Fix stale root domain in cpuset bandwidth transfer Juri Lelli
2026-11-03 13:26   ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
     [not found]   ` <CGME20261105102052eucas1p2fa2d23d1c49cdadef3b1099e18ffb958@eucas1p2.samsung.com>
2026-11-05 10:20     ` [PATCH 1/4] " Marek Szyprowski
2026-11-05 10:38       ` Juri Lelli
2026-11-05 11:16         ` Marek Szyprowski
2026-11-05 11:22         ` Ingo Molnar
2026-11-05 11:32           ` Juri Lelli
2026-11-03 11:26 ` [PATCH 2/4] sched/deadline: Fix total_bw leak when switching away from SCHED_DEADLINE while !queued Juri Lelli
2026-11-03 13:26   ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
2026-11-03 11:26 ` [PATCH 3/4] sched: Reject SCHED_FLAG_KEEP_PARAMS when it would change scheduling class Juri Lelli
2026-11-03 13:26   ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
2026-11-03 11:26 ` [PATCH 4/4] sched/deadline: Reject SCHED_DEADLINE on exited tasks Juri Lelli
2026-11-03 13:25   ` tip-bot2 for Juri Lelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179371235835.1009794.6060109721665812114.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=weihengqiuu@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®