From nobody Tue Jun 16 19:32:16 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 C59DD33F5BC for ; Mon, 20 Apr 2026 16:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776702856; cv=none; b=a7LQUy9H6gXS5o+vvqbQm39W2a1obbEz+IAvuRKtmqxniT/dDl54yGug2cxBRHvkaTmzInYHiy8bUlnFsAHvjXO1wlANWJtFafn+iFLr7JK82gBRo5+izjNzkmwXMcZ2uRqJVmSQ9xFDdryn9ojfRDZnsSNtv5YKG5rO5Xpm73s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776702856; c=relaxed/simple; bh=P8gi7LGJap2dUwgfoQSdtPjx8bSj0octRDDK4o6oKJc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=g/9ZMZwkUN0B6SQQfwLsXFURl2CkQZonY+KKAWTujtqBsp6Nr7oz49+OvWE2WW/2bfaE1uAvFi7ydt0F6dm72YfxUZmr4XgKIEIelfr1aK0Cv7yoHDJiM5Ob6wx2IOqHr+az5IP+1Y/HvB+6NX12ddafQbeKEhwkvj/4YJtt/k8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D2+uaa09; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D2+uaa09" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so23694185e9.2 for ; Mon, 20 Apr 2026 09:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776702853; x=1777307653; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=62g9hCvQ40wMjWC1ntpK1rXl99qO4EdqVNIeqMfcdlc=; b=D2+uaa093kFcSDqliPd2osWIEIjKMuYW93G2fU7Ye/tc03umhVB+v088ZpDImqinD3 aPcfwsVAAE6LhMzArrXIZYwZ68yMyJZs/cDDS4s6CtXRoLVKh86wEqrX+ee0qsAIIX8g noPHKoNmzuk7n2uSKSvpOi/1STeOD7C0tMTp78LQh5cRPwdW4JQXDArEvPCqS10Eb3Pb 8nRBb+DXui8Hgu8fYYZlZ5KRWaa07CpgZoOpqNyIDyGqjl1Wy1p1pE9ey5p7T5lpGKAw bb2dpwzO5UeG+WZjfv232/+EiyCQJxs93KKq4/46VrrE2LUShpPVY3NFHy2JUDkevMA5 nQTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776702853; x=1777307653; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=62g9hCvQ40wMjWC1ntpK1rXl99qO4EdqVNIeqMfcdlc=; b=NVXt5ge8c3bA+iRxSaOpKlK7yratsblb8qMFGlfwOKmtAMy4JyoWNlwLoUwIJBH+i+ 2z/azXLukK/hB7nAG6XnTS21rs8qp7B3U7q/z7f608biTr8yFPsnNJijF/P0xEj/SXiD Y8k2Z7Rotj8YGHCqRiJBya5TDuc1P/CM70pfMVAcD4TNPmotgFyP+Jq6buNZhyLjh6j2 Jzhu7uOp7JpRE2sCrag/pSo6vcPmjoKlNT65ayt4fEqs2yfsoblYRy23gI6UxdppY4/5 0yqonDL+zaLis5RrWi7uv5vD0FBY6uIIBBsH4wFHyK6YPpXck3XWONsPXiVF8/XWn/RT Fbdw== X-Gm-Message-State: AOJu0YwLn4vXGU/C42dI2/rJbT88Vt1KBQkZaNi3hShUFZe2qVMFoQTn sda7JM8TXGrOkNszsxcVyOM5L/4VBTOR3uNPK5hVajlfevp72FpMaAzc X-Gm-Gg: AeBDietXA28bpRFc4/fw3hlg9oq0An9Mc5URx56YJTbwOsGvZXYJX9ekRIqtfpsMzkA Qpa/ICaGI3P9H+gkGMjZnZN+N1OMPjWWmohaFbtgqH0fl1rZifr+BUx2GtZbYtSq2ePMpoydbGv ravOvyf3v9wUQaUdHcCfXwa04mwcOjZQlbDBOcwE9nJbk7fsfVDDqgjpU3uzs/uqqeX3PXDi7Kd i6ktu3hvV4lb4XqoY1zGmO7FRqdF2zNjWX4hPpDfd0aA9VZvmrf8XOTmO5fo5EqtCGBlJ3y8iet 38Fk3LathebMwCC22x8Z44zCn3g4RRR7qBY5K/kfAnshgRudWE50BfP2I0DG2c23Yp/H5KqC2Dj OUJYLLpV5K0dH8oZmgDpFDBFHv2e9hBMqMw3uiOtii8Sm/5tc52221ShIVkOFD38pT+hBA+1vD0 Jnm90yt5JsA6Nv7Xw8+b5ai+2VMYgbQavTZE1Qi5IUzSCVE9uhUvHdz2NJd+dyy3yXnigeoof9c upTC4eYaFc= X-Received: by 2002:a05:600d:8408:b0:488:b8bc:6a32 with SMTP id 5b1f17b1804b1-488fb7857c6mr151543225e9.23.1776702852816; Mon, 20 Apr 2026 09:34:12 -0700 (PDT) Received: from yuri-framework13.sca.unipi.it (opnsense-fib.sca.unipi.it. [131.114.30.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e4d112sm34026515f8f.29.2026.04.20.09.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 09:34:12 -0700 (PDT) From: Yuri Andriaccio To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider Cc: linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: [PATCH] sched/deadline: Fix replenishment logic for non-deferred servers Date: Mon, 20 Apr 2026 18:34:10 +0200 Message-ID: <20260420163410.20808-1-yurand2000@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A special flag of the deadline entities, the 'dl_defer' flag, is explicitly documents changing the behaviour of deadline tasks and servers to the speci= al deferred behaviour that replenishes and unthrottles the linked dl entity ju= st in time so it does not miss its deadline. Currently, this behaviour is only used by fair-servers (and ext-servers), w= hile regular tasks use the original CBS (Constant Bandwidth Server) rules. The bug (and fix) which follows is of interest to those deadline server ent= ities which do not request the deferred behaviour (i.e., dl_defer =3D 0): whenever a non-deferred deadline entity expends all of its runtime it must = start the replenishment timer or, if the wake-up instant is too close to the curr= ent time, the entity must be simply re-enqueued and its runtime replenished. Currently, the 'dl_defer' flag is ignored when replenishing any deadline se= rver, defaulting to the deferred behaviour, while this fix correctly addresses the issue. Unfortunately, no testing of this bugfix is possible as there are currently= no deadline servers which use the standard non-deferred behaviour. This bug was discovered during the development of the Hierarchical CBS patch (https://lore.kernel.org/all/20251201124205.11169-1-yurand2000@gmail.com/) = which makes extensive use of the non-deferred servers. Thanks for your support and have a nice day, Yuri Signed-off-by: Yuri Andriaccio --- kernel/sched/deadline.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index d08b00429323..19e63d1307b7 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1523,8 +1523,12 @@ static void update_curr_dl_se(struct rq *rq, struct = sched_dl_entity *dl_se, s64 if (unlikely(is_dl_boosted(dl_se) || !start_dl_timer(dl_se))) { if (dl_server(dl_se)) { - replenish_dl_new_period(dl_se, rq); - start_dl_timer(dl_se); + if (dl_se->dl_defer) { + replenish_dl_new_period(dl_se, rq); + start_dl_timer(dl_se); + } else { + enqueue_dl_entity(dl_se, ENQUEUE_REPLENISH); + } } else { enqueue_task_dl(rq, dl_task_of(dl_se), ENQUEUE_REPLENISH); } base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c -- 2.53.0