From nobody Thu Apr 9 18:00:38 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 4019DA59 for ; Tue, 3 Mar 2026 18:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772563424; cv=none; b=jASjqtwXzrn/e9Ahk7tjx/wJ2IX2Q07D8nsvCgUFSzpvIwuuBOLOQvUjID6jybSkl1MYlJZwexOO+paQmrdTwORr0Vt15ycECnuFz8i6INciUm0Hef7mYkZhxwIyL/5ZqV1DFRHARMPBnGbX2GQizi6zvp7gNjpNy5KqOMSH0CM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772563424; c=relaxed/simple; bh=qDvE2HJEzyMcQRpPVVWxoIOiiyNAJs6RPSw659rPKdw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sBKUWxhw0kXjmfExTEl48X1BwOIq8WjPVyVIt8HTbZ/ebeFrPtdAOoOBqrhKd6ie4WfECwKrLKNWI8T3i0OgpHznn259jqappcVRFxb/DS/UGd7LH7AEht2OPk36AYFAfffvYYISDqY767lPBpF6tgW90g7u1MyUJWjtcpI2kz0= 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=ln0RcmFl; arc=none smtp.client-ip=209.85.128.43 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="ln0RcmFl" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4806ce0f97bso51434045e9.0 for ; Tue, 03 Mar 2026 10:43:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772563422; x=1773168222; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WX8r5kTeexA5hjBkPMWcoH7tf0SLIu7YLl43ZFEMlvc=; b=ln0RcmFlqg8xmAq8QVHCExDdtxLGmej1nQ/XA1rN2L4H5xD7P2204wOEqASZbpIwYx 7T31BHhhhI7pkx6tXZoYMUecKICB3HZ4gAekCMG4Jo2YX6TO+ieWb3ODknjDtW476mE+ mYFrzZ/lbCi63g5fwuoQ1Mc/4T5P8UIMmffSu8iiyzmrnkGgxWWxuQ/XgVV192mGYc6j l1Nj8OCMuDQb1il8SCsFaW79kVEK0PdVFwkjUKHJCOnElt+WyGRg28tlfxwtCyl2Z+iw mJ9q8pKwxnH3oOc4Su2mXoR9j686PPTfmWrJVPeDPZydPa/AujL2J9LPKsCTvj+PhtnC rJvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772563422; x=1773168222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WX8r5kTeexA5hjBkPMWcoH7tf0SLIu7YLl43ZFEMlvc=; b=iWPA4NYV4U1UlJqYSR9oOoC+iAm82rBgjpr7k0FqxgPYpDDpXlZ4jwbY7UnJYGhcDb TJYR+vjnsgFUL7kBtWJwUb9qd7hg0kmWN8HviTEEVSVXOkI3Fe9VzTUrKoZM0jDnqn2N s1u/c1L4WqnzSSELKqn+2N6saD8vsZpU/vtPB4oZlx+OcW7Nihf0Gy6pZWuTUJ05zdde Yy8eJFKFbHBBqlFvDjZ9msHIuoTmz4vNO2Cvw2W1g8PQ6Vp3/xyoEzgd5YFmpNRXdhwy z+Snt4GiRXD1PNmlJY4TaDQeRuUjAXKF57QZja6jL2UXkZlDPt50qClvySuEYHfWk1X7 Dglg== X-Forwarded-Encrypted: i=1; AJvYcCU/EN2rEoDipx25cJ+DRomvqkm4WjkWkCyW7jl+Z5BOgExhOMqfqJ+rNrX+sqq08ewr5Om3OEe35Dv7t6s=@vger.kernel.org X-Gm-Message-State: AOJu0YxXjD/BBsxgi9dM35kQTvcgkEBpKUv0Yz/BpU4Kq/9qlVwQHYHd dNY+vOYILFpBvunpMRc3KmFX6/oHQcwc9veE/yuk71jNl5dYVVQi8TuY X-Gm-Gg: ATEYQzyfK/mY6HBem82Y3rb61zc7JqfLjfCZaMBab1rmpySbkhYsnfQ16zSvvtYbLfR CXxnxxNJqTg3IlC7F5nBubYzWDCdnSNpiqA4lG/lf/wNtnSE1NEgBEBHiC2UdTFSmCSZ+rqxood Sx0prEpgT78JV9f4jB4BJLlX7N0+Yya6aARUkJnbe5JN4bKInedT7q2jRRFRdEQ7eeUJQscmlpb pMewP5z9E3evs/y//gPVKN/coAERVm6lftObptLLZ+YU3nOJdWbDaF8YWFTzLhg0rHG2GXbx/nf 5WgpFPB4+U1Bzd8WIud6gkgHKjsMsgpnUGCZBkTv5T3667n61MJyaMYZAgSc7IDgJfzizEd2rCp k+VGN1W7epKTeZbnED5oMi/BMKlE5RNtKpOZEXdxZEIrggSJ9FMfnkFfoJRp/CUFaghPCZTh/mv WwUM/f5nnj6WVPfhO3mLR58Y/JFM59+w5ilWtaRf4ORBNJ1ZHXocmRw24hwrlRvRzKphrD7p1Y1 9NWPID6qndfJISUwEH5BjO4ETNKhgMEYuxU X-Received: by 2002:a05:600c:699a:b0:471:700:f281 with SMTP id 5b1f17b1804b1-483c9bf44e8mr275137185e9.25.1772563421171; Tue, 03 Mar 2026 10:43:41 -0800 (PST) Received: from laptom.homenet.telecomitalia.it (host-87-6-205-41.retail.telecomitalia.it. [87.6.205.41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7031f3sm444134115e9.6.2026.03.03.10.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 10:43:40 -0800 (PST) From: Tommaso Cucinotta X-Google-Original-From: Tommaso Cucinotta To: Peter Zijlstra Cc: Tommaso Cucinotta , linux-api@vger.kernel.org, Juri Lelli , Jonathan Corbet , Shuah Khan , Shashank Balaji , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks Date: Tue, 3 Mar 2026 19:42:48 +0100 Message-ID: <20260303184313.1356499-1-tommaso.cucinotta@santannapisa.it> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it> References: <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it> 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" Document in Documentation/sched/sched-deadline.rst the new capability of sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absol= ute deadline (setting the flags syscall parameter to 1), in addition to the sta= tic parameters (obtained with flags=3D0). Signed-off-by: Tommaso Cucinotta Acked-by: Juri Lelli --- Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/sch= eduler/sched-deadline.rst index ec543a12..76fdf435 100644 --- a/Documentation/scheduler/sched-deadline.rst +++ b/Documentation/scheduler/sched-deadline.rst @@ -628,10 +628,21 @@ Deadline Task Scheduling * the new scheduling related syscalls that manipulate it, i.e., sched_setattr() and sched_getattr() are implemented. =20 - For debugging purposes, the leftover runtime and absolute deadline of a - SCHED_DEADLINE task can be retrieved through /proc//sched (entries - dl.runtime and dl.deadline, both values in ns). A programmatic way to - retrieve these values from production code is under discussion. + The leftover runtime and absolute deadline of a SCHED_DEADLINE task can be + read using the sched_getattr() syscall, setting the last syscall parameter + flags to the SCHED_GETATTR_FLAG_DL_DYNAMIC=3D1 value. This updates the + runtime left, converts the absolute deadline in CLOCK_MONOTONIC reference, + then returns these parameters to user-space. The absolute deadline is + returned as the number of nanoseconds since the CLOCK_MONOTONIC time + reference (boot instant), as a u64 in the sched_deadline field of sched_a= ttr, + which can represent nearly 585 years since boot time (calling sched_getat= tr() + with flags=3D0 causes retrieval of the static parameters instead). + + For debugging purposes, these parameters can also be retrieved through + /proc//sched (entries dl.runtime and dl.deadline, both values in ns), + but: this is highly inefficient; the returned runtime left is not updated= as + done by sched_getattr(); the deadline is provided in kernel rq_clock time + reference, that is not directly usable from user-space. =20 =20 4.3 Default behavior base-commit: f74d204baf9febf96237af6c1d7eff57fba7de36 --=20 2.45.2