From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796183574; b=xmMGGHhUzre/tBnRSBBEf/oiKb0U85ehuCUN6EDC0PdDhQJSPXQiB7RJLaqJ/TknZF4e WdYqmbf/1/tdSxX9tQ0/u9B873pRu29WjJArw666W/G+SJdoaKkVvH12BN5boUxxwVp3p Rkx0V32sSOO+1EugCZSmsT89KclAx19RfCDeBblwVxR2LuM6ZqaYGum4ST6Xk1xCURQRQ ieAm33jdl3SDAGX3MuhFb15KlaXX8cDlUbMK1ylaR0fqPTnayQWZSe1Ohk0zq8OdD8Q81 8a6sGQailVHZhl6AZMrfgSZOqMImWFLZfkR9gJlUjAytb7R+Qlk4ptaSrZ7NdGW97lg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183574; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:In-Reply-To:Mime-Version: References:X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=tAsXs9HhZ+gKFL425tC5o7FvgkC46Xia2qG1zv4YOVU=; b=rKZFvoJdkIDSNN4NIEGV8v8JxoOv+LHZ77z2HN0NcNlD3+s2tYC0aKolIt6F5D8gY/7k O3gg7F56dpIYAeJi//S7b2/e57pQGzSuhVo2Oi8d5SuejU7OWTSwthfaLu0GOigeDzFZ7 Nq0ZbBVltLxOYk1/l3yYtPzlmg9D64Rfp/aEL0bGmudC9N7aOKVL0z66JyC6CwAZugzEt 9dPL5+cHyJ6t3jeJgAqSndpzYzmnCHXvJfUFtMZWbBBOvO4vQveNfBGIVxGCzAuus6kQ9 omBdPcevYc9AhmH9NfjxQ3ipXT1xQTAYhfSVTrIfgC3ZcC/QIRUtz95ahXuKOiQEL7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--jstultz.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=HTan7CO5; arc=none smtp.remote-ip=209.85.216.70 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A3EE606A336 for ; Wed, 2 Dec 2026 03:52:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2A3EE606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jstultz.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=HTan7CO5 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3b574438300so3939021a91.3 for ; Tue, 01 Dec 2026 19:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796183573; x=1796788373; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tAsXs9HhZ+gKFL425tC5o7FvgkC46Xia2qG1zv4YOVU=; b=HTan7CO50hN+MXNUgpppVlgF/edzyfXBjjcmS+LBXmQAiY8DW6mXjiohIGuuRQDcg6 nYDcTn2MfYd7sD77QOQkl1C3zBLFxClm9hbe0bLuOY6vo/Lrx/MlQ4N3PtpncvQj6VDM +xXtWZERS69/CfOxf1ma/sqYpxUYyTBsT0DnYY0q86MVt550WXykT2zS0AbKEihIRkhy WaLUVcuzLX8ah99Vg9fHzw3FWfHZi25cAp2oQOWIIAfiKvHcJ0de5q1pk5PTtvmMzE3b 6irtwD4EBygdwpdMRvHACIBmq+HI8Vg1NrcAIXCH4sv5+kayZz1O+xive1MFGnz8bJVq Hlqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796183573; x=1796788373; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tAsXs9HhZ+gKFL425tC5o7FvgkC46Xia2qG1zv4YOVU=; b=tp5+fEiwP2y1P/3mK7lMAu7Gm9fd1HB39Fis/bzIC6PmRRvsca2D2QqU1IM/mXvvBH w7FOMJVlOqlwsX2BfIxOoaZmGuMXbnld1KawIa+lL87l0Jk2lxH13iMfuibtUaOa/f7c XveKWXUlJ6/X8DfWO3GPpXIFuV65hFjUmLbMAPG89AXODIbigsS3sfemWhLCD+kMgt4v EiwNceM4iXhCXYgCVFiBZ0i8dDb7HRfQSf2Vi2NMExi0136QNTTw8fXh3EXq/+WeARn/ NOnFOHziq1omudfUBBeldZ8w9uTstoExiz541MlgJ3GPP5JWb0/jhhQgQWcepODar1BD OHtA== X-Gm-Message-State: APuU4Z/eXqHF3AGzBF0qJIXolWCJBcHe3X3ktd+HQZsTsXbEuoNEDb4L EI0A+YTa51PmrsTwZkzB2IPZVlM3QGy4FGPwpN0VjdD/+xRlSAtFUbPNxh3rhhEvai36NKtj4oF Z8svpKkwMkOgu0tQnMU80gsjL+IuOgdDMsPaE+013tzx64PxNOE7mzD7KttvjCwQzzhhKrwJ8mK YBNfR6STcHEn6cvFmRfBcL3HommWRuiiCPFEvUvGNjAQy/J4cV X-Received: from pgcle6-n1.prod.google.com ([2002:a05:6a02:8b86:10b0:cc7:ba91:a719]) (user=jstultz job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3c06:b0:3b3:c9d1:9b65 with SMTP id 98e67ed59e1d1-3b41c94d32emr39821865a91.51.1796183573051; Tue, 01 Dec 2026 19:52:53 -0800 (PST) Date: Wed, 2 Dec 2026 03:52:32 +0000 In-Reply-To: <20261202035248.1210026-1-jstultz@google.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 References: <20261202035248.1210026-1-jstultz@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261202035248.1210026-5-jstultz@google.com> Subject: [PATCH v34 04/14] sched/proxy: Wake blocked RT and deadline tasks through the full path From: John Stultz To: LKML Cc: Mathieu Desnoyers , John Stultz , Peter Zijlstra , Ingo Molnar , K Prateek Nayak , Thomas Gleixner , Juri Lelli , Vincent Guittot , Valentin Schneider , Suleiman Souhlal , Andrea Righi , Johannes Weiner , Metin Kaya , Dietmar Eggemann , Steven Rostedt , Zimuzo Ezeozue , Waiman Long , Boqun Feng , "Paul E. McKenney" , Joel Fernandes , Qais Yousef , Xuewen Yan , kuyo chang , hupu , Zhan Xusheng , "zhidao su (Xiaomi)" , Hui Su , "Shubhang Kaushik (Ampere)" , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" From: Mathieu Desnoyers With proxy execution, a task blocked on a mutex stays on its runqueue. The RT and deadline classes do not put such a task on their pushable lists. enqueue_task_rt() and put_prev_task_rt() skip a blocked task. enqueue_task_dl() and put_prev_task_dl() do the same. find_proxy_task() migrates it instead. Commit 7918cf369361 ("sched/proxy: Only return migrate when needed") wakes a blocked task in place when it is still on its original CPU. That wake-up does no enqueue. It also skips select_task_rq() and the task_woken() method of the class. So the woken task is runnable, but it is not pushable, and no other CPU can pull it. A SCHED_FIFO task woken this way waits behind a higher priority task while another CPU is idle. In a test on two CPUs, it ran 500ms after the mutex was released, when the higher priority task stopped. Without proxy execution it ran at once on the idle CPU. The test uses SCHED_FIFO. The deadline class has the same code path. Fix this in proxy_needs_return(). An RT or deadline task takes the full wake-up path, as a task that was proxy-migrated does. The other classes keep the in-place wake-up. Fixes: 7918cf369361 ("sched/proxy: Only return migrate when needed") Signed-off-by: Mathieu Desnoyers [jstultz: Simplified the conditional check a touch] Signed-off-by: John Stultz --- Cc: Peter Zijlstra Cc: Ingo Molnar Cc: K Prateek Nayak Cc: Thomas Gleixner Cc: Juri Lelli Cc: Vincent Guittot Cc: Valentin Schneider Cc: Suleiman Souhlal Cc: Andrea Righi Cc: Johannes Weiner Cc: Metin Kaya Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Zimuzo Ezeozue Cc: Waiman Long Cc: Boqun Feng Cc: "Paul E. McKenney" Cc: Joel Fernandes Cc: Qais Yousef Cc: Xuewen Yan Cc: kuyo chang Cc: hupu Cc: Zhan Xusheng Cc: zhidao su (Xiaomi) Cc: Hui Su Cc: Shubhang Kaushik (Ampere) Cc: kernel-team@android.com --- kernel/sched/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9ba25925c928a..eb2ab495f1df0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3875,8 +3875,13 @@ static inline bool proxy_needs_return(struct rq *rq, struct task_struct *p) * only set p->wake_cpu when !p->on_rq, and since here p->on_rq, this * will not apply. But if it did, this check is the safe way around * and would migrate. + * + * The RT and deadline classes place a task at wake-up: + * select_task_rq(), the pushable list, a push to another CPU. An + * in-place wake-up skips all of that. So their tasks take the full + * wake-up path too. */ - if (task_cpu(p) == p->wake_cpu) + if (task_cpu(p) == p->wake_cpu && !rt_or_dl_task(p)) return false; scoped_guard(raw_spinlock, &p->blocked_lock) { -- 2.56.1.911.g883d8bcb20-goog