From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03F9F33F59D for ; Fri, 24 Jul 2026 18:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784916765; cv=none; b=MkGZX/HIIVSqK8tAClB+HpXrHBjx+x6HdLEQX9ZNO307FPDugB0S6IsTUr5TIRIwcuTx2UAADsxYfvIVdUUt4WkyA/8YWHSwKgFeMV2HW3Fr+BymGjtT+ZcmKetGK7cz/IJPNEmO/OJVMvoDAO9TN0N3z9asz31XutlHj6mXiiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784916765; c=relaxed/simple; bh=ovv5Ac47snxxQ+Z9R6rGJxumNVj0VNE9iu5ZB64X1mU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WGpQ3FbP3wJrLhPKEKQ7KUfgq/xmnpjCsflfytf5BgZdXf5lkRxbRcKbYpLv8H84SomV7eMD65xPTXsgwexY+2dW0s0wZ6LPgIAm57y8zcIw2XnK+O8UVuSIa0UKBmbxfQ7KFLV/9Z/h7QN8Dtm7MHIrRoN71fUKXoudDtMhaBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jstultz.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CDoFm3L2; arc=none smtp.client-ip=209.85.214.200 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.b="CDoFm3L2" Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cfca8558d2so8806815ad.2 for ; Fri, 24 Jul 2026 11:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784916763; x=1785521563; 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=xI6yi0/ES/KMSLcG2AQHgX5uE8KlWDgTw1GhLrDHkOQ=; b=CDoFm3L2nWQelsBpcnE0/hI/FuX7DfQ7CbD+uQUI8XMJzRX94NGWknQ2tmbFE4nU6O v1spSc0el6G/OXR6o5MivcUJmcdZlnMLaZLn1FuUdBvXl5dwtx7rE9caUb3ktWfA03s7 DyE/uT6nfpLpdNShwmQGTEIQPOxmoutDeWw4YFqbVW6khe0II90pnVavlS3K00o2/E2P svr3g1rwjNVQuJBY5AQZ5SYc8mKPPottjoSzTJF6uju4zEy0KR/MJVH/Lxjc9oT1/F6r gu7KxXJ5IuaWtdIU42xjK5myizJQaDHTDghiKNylWmmGcYDnaBCM0akRWL2KybPNW5aM thzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784916763; x=1785521563; 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=xI6yi0/ES/KMSLcG2AQHgX5uE8KlWDgTw1GhLrDHkOQ=; b=g/lJm5d8TIIlZYQbHtklAphVM7//49VCCvZfuXq4B2xEz/R+eRb3qilIBi5/rWBHKT 0c9LHZsaE1bMPs4f+EvJ2WZZPPozNtnIyMsztGO2CFheuQwxk0X+GedMSYFdO91fDN2r +T7NBhgbcWbjv/uv87ZQY6EmWSnKta3BalCftMQKCJTb8ZZ7Fxyv9Wq25Bke1ZNM5DgF xAC6MEfaWKcvAIk62bMhKoh9rzYM/dsmGcm0S02kPym9/E2YISNoTX1ebHo0ATpjnnc3 EIJOPsJ+krlymdXfX2VDtQ+M4xr/faLF8KNwA+iMp6aBjA7FjlA6/8UqFDIj1TfISEar M1vQ== X-Gm-Message-State: AOJu0Yy5aufaLF8cobP180D7SPCjVvtfT6OJnsMQW0NH1A55yB/BNIrN gklNOzaN7vKUBI/2ksYzGVtHwckfmmMlAHp7kwvhfwP533UUmGg4Ytf4+sel/tjoOZJljfuqd+w bbwlE2kBXzVhzMXTuG6r/ZXa72np0duOeXRRfSadleMG+xyh+pFQiAmKv+z7Tux9Ibcfw15ykiR jyqMfXeyNsgymgUpsPCwSlG3HiKZ36XnQzLaGN2S730AuC7nZN X-Received: from plrp20.prod.google.com ([2002:a17:902:b094:b0:2cf:a0e2:93f7]) (user=jstultz job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f68e:b0:2cc:8267:31b5 with SMTP id d9443c01a7336-2cfa6b77a03mr96771255ad.19.1784916762892; Fri, 24 Jul 2026 11:12:42 -0700 (PDT) Date: Fri, 24 Jul 2026 18:12:15 +0000 In-Reply-To: <20260724181238.3445275-1-jstultz@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260724181238.3445275-1-jstultz@google.com> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog Message-ID: <20260724181238.3445275-2-jstultz@google.com> Subject: [PATCH v31 1/9] sched/deadline: Ignore proxy-exec sched_yield() From: John Stultz To: LKML Cc: Christian Loehle , Juri Lelli , John Stultz , Joel Fernandes , Qais Yousef , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , K Prateek Nayak , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , Andrea Righi , kuyo chang , hupu , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" From: Christian Loehle With proxy execution, rq->curr is the execution context while rq->donor is the donating context. rq->curr's sched_yield() is dispatched through the donor class so that proxy execution follows the effective scheduling context. For SCHED_DEADLINE, this is too strong. yield_task_dl() does not just ask for another task of equal priority to get to run, it marks the current DL entity as yielded and forces it to sleep until replenishment. These yield semantics are fundamentally different from FIFO/RR (where if no equal-priority tasks are runnable, no harm done, they get picked again immediately) or OTHER (also doesn't cause priority inversion), so do not mix these semantics by ignoring a sched_yield() on DL donors. Fixes: 127b90315ca0 ("sched/proxy: Yield the donor task") Acked-by: Juri Lelli Signed-off-by: Christian Loehle Signed-off-by: John Stultz --- Cc: Joel Fernandes Cc: Qais Yousef Cc: Ingo Molnar Cc: Peter Zijlstra 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: K Prateek Nayak Cc: Thomas Gleixner Cc: Daniel Lezcano Cc: Suleiman Souhlal Cc: Andrea Righi Cc: kuyo chang Cc: hupu Cc: kernel-team@android.com --- kernel/sched/deadline.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 0f858b98c9aa3..3e89b3abeb278 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2574,6 +2574,9 @@ static bool dequeue_task_dl(struct rq *rq, struct task_struct *p, int flags) */ static void yield_task_dl(struct rq *rq) { + if (sched_proxy_exec() && rq->curr != rq->donor) + return; + /* * We make the task go to sleep until its current deadline by * forcing its runtime to zero. This way, update_curr_dl() stops -- 2.55.0.229.g6434b31f56-goog