From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 4622330C637 for ; Thu, 11 Jun 2026 02:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781144098; cv=none; b=NC78OEZ7lVF9QMUfUXtVJHLEtlh6xdkYeGDGcBcUzZEyv+6AFOMFGdWJEQqhTYcMmNWsU6nCRm4qHzYS5F226eX27XeXRrFYw4xXsojwoiUpCkUtWP4KRRRORv2xsQqPXbcPbYFrNjQ+hyd8JEAnyHLaVApHzSNvYICjASie20w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781144098; c=relaxed/simple; bh=HyfBnjGWzBchAn7pQsaKXg/K5m2UN8OpDEPys0B3oog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PBjb3cJyIpHKMpK2rggO4VW4M0/34PcFEzW1cYfflqhnSVwaKozhoHbHMapYU/wr91A6QB4r0L+J/1W++pa9gfm3c/D8Gj7/8uqE1XdsbE5rbBs/jAelRYfTok4dzl0ZXMPaJD/vCWEh1ucyN+AbUkerLmpnYbSIxkgirh0Jn4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=surriel.com; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b=QPpjN1wI; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=surriel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b="QPpjN1wI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=surriel.com ; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WiToTaqfFidRh1op9J9Ch52dj15KeXyHD885DwNxmz4=; b=QPpjN1wIHcsigt7TsI3ekdPEyB wXCcNpASXapwsAkjLpmfRi15YZos9RYJBWBukPjzCKYYeFjF08hnToXwUHwnwqhSJcmiKsQqDXsFw UDxwi1fILw6wOqTAFQzXT+MHk4LxKcl4JV7kfo61Mf6Ki6QTpguFACkyFy3+Bh4rv24JFBlraovNG tmSKEKg0zNqGjLVSbzMQgb/76O93ySTlk4rlHqPYvdcYIVpITbYwsYlgmVBeOzHCnRG7Ww/gHeGNf t0xUIXa+BfIyoq+ynYidOW28Em/fHshXKBrGRHAIxhqwR3EPj9eudtWD5GCgtL1iNeVdv+zNRrDha 5qqz5zkw==; Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1wXUwJ-000000003Zo-0vnl; Wed, 10 Jun 2026 22:14:39 -0400 From: Rik van Riel To: linux-kernel@vger.kernel.org Cc: kernel-team@meta.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, vschneid@redhat.com, Rik van Riel Subject: [PATCH 9/9] sched/rt: defer WARN console output under rq->lock Date: Wed, 10 Jun 2026 22:14:16 -0400 Message-ID: <20260611021416.910555-10-riel@surriel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260611021416.910555-1-riel@surriel.com> References: <20260611021416.910555-1-riel@surriel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Convert the WARN*() calls that run under rq->lock or ->pi_lock to the SCHED_WARN*() variants, so their console output is deferred to irq_work instead of being emitted synchronously (which can deadlock via console_unlock() -> up(&console_sem) -> try_to_wake_up() while the lock is held). This should prevent a deadlock if these warnings fire with a legacy or boot console configured. Signed-off-by: Rik van Riel Assisted-by: Claude:claude-opus-4-8 --- kernel/sched/cpupri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 8f2237e8b484..5082fb228a63 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -149,7 +149,7 @@ int cpupri_find_fitness(struct cpupri *cp, struct task_struct *p, int task_pri = convert_prio(p->prio); int idx, cpu; - WARN_ON_ONCE(task_pri >= CPUPRI_NR_PRIORITIES); + SCHED_WARN_ON_ONCE(task_pri >= CPUPRI_NR_PRIORITIES); for (idx = 0; idx < task_pri; idx++) { -- 2.53.0-Meta