From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4F9FD3DE43D for ; Tue, 26 May 2026 11:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779795450; cv=none; b=QNPjbo3heyxEj/5Cy3wsETNDfaA2zVsnY/THsOzduJIOr94ifFx2PBfzLnok8ZhJYIvuJ5Cf1ozJzpCh8ApU1fXkY/PFZo4lG5xlY6wl2AZBv+cFgWP0Gz4bgOgVHvDa+rqBBG62dzEInuvPNNcXX25b2f4BL62ahQnJgUfQo+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779795450; c=relaxed/simple; bh=tau4FSth8sgMFh0UrOnpIuIpqklAnd9eIaPrhRTo69E=; h=Message-ID:Date:From:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Cc:Subject:References:MIME-Version: Content-Type; b=UlJFgZJWhopg57SNK/aGro6s6Mtfvk3GyQrR8PHXl4En3qlCPyq+zY9+KoDIxVWAmClM2xFwKJmkFcks4WRIrIDUo+hyH6M1JsflrNrYFrvRCOXM3ICtYzlYSrYqegCytPccTpOUTk7YkqrdbjV5/69SBOySIShFP/iAfkxNe/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=J2QzXWah; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="J2QzXWah" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=wGN1IyFUzbOpWlJeTtIkgrO+8lsk4Jnkxv4B2FoNGlw=; b=J2QzXWahEmKbAqjJF2E1jn3p+e zj5jSZxE6kGuFHoaz2HxzIwhlSiMjA3RmNM9IyoSOIdgkR8egluCNaTSKamcWU4KlmA6qKqyEZzSo sSBgENfyfWed9xQPuWaFrndicz2JtCh98R0BhjWWdGLYI/4fk5+pKnUNDiSw+J7eBchkbGQFa7CSk w/V5jRCAJiMNPGV1U3zIfNrt6CDs2uYR/ljfyJCUD5AACwbJxrDQp2zEmR1tUus3HklTO2JAMVn8k NTgLlBkk0XcjmuAAJvVZl9XL5gW7AnCSX8yidrtGO5/Q0DjgdGOZ3cpUaXrtBTTtkPuRRZ5otuvNu j4R3rFHA==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wRq5x-0000000B6hT-3wVc; Tue, 26 May 2026 11:37:14 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 12606301CEB; Tue, 26 May 2026 13:37:13 +0200 (CEST) Message-ID: <20260526113322.364017314@infradead.org> User-Agent: quilt/0.68 Date: Tue, 26 May 2026 13:16:12 +0200 From: Peter Zijlstra To: John Stultz , K Prateek Nayak Cc: Joel Fernandes , "Peter Zijlstra (Intel)" Cc: Qais Yousef Cc: Ingo Molnar Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Valentin Schneider Cc: Steven Rostedt Cc: Ben Segall Cc: Zimuzo Ezeozue Cc: Will Deacon Cc: Waiman Long Cc: Boqun Feng Cc: "Paul E. McKenney" Cc: Metin Kaya Cc: Xuewen Yan Cc: Thomas Gleixner Cc: Daniel Lezcano Cc: Suleiman Souhlal Cc: kuyo chang Cc: hupu Cc: linux-kernel@vger.kernel.org Cc: Mike Galbraith Subject: [PATCH 3/6] sched: Be more strict about p->is_blocked References: <20260526111609.433880331@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Upon entry to try_to_block_task(), p->is_blocked should be false. After all, the prior wakeup would have made it so per ttwu_do_wakeup(). Ensure this is the case, rather than clearing it in the path that doesn't set it. Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6676,8 +6676,9 @@ static bool try_to_block_task(struct rq { unsigned long task_state = *task_state_p; + WARN_ON_ONCE(p->is_blocked); + if (signal_pending_state(task_state, p)) { - p->is_blocked = 0; WRITE_ONCE(p->__state, TASK_RUNNING); *task_state_p = TASK_RUNNING; clear_task_blocked_on(p, NULL);