From nobody Thu Apr 9 16:36:11 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 B588639D6D8 for ; Tue, 3 Mar 2026 10:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772534586; cv=none; b=fWHmE8TRPTa610hR2YPoP/Hb/y+ypG28Mk4xigXIYrBducmbR4zto/9kUySmPX8Td2znu1MPXxXO0pbQHd9S+LYJciQwIPqSwLyAJA7uSThf5XyIa09llRRbALFDffFjsFIHTlMkYrGEHba6Y5udeIw7oBg/l6aBKX0VkEZbedg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772534586; c=relaxed/simple; bh=9KICIc5I6I8duML0IPQQ8kLOZtf/iu5nN1pCrozWAtw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VvssVL26YKUymDPc6eqpxorfvlYUk3yjYb1K4mJYvzjjl3BnB/e+xgLUfG8Sx57mc2kspJadg6xvwdCKjnf0ECpcacjbKXgn2tWbXH5M96GXKRVRLB8M0jgVF9W8+n0dW847je6WLc8mPVzY/DrJJSlgmBZ4BocssNeRiEqtPFU= 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=gMkju6jn; arc=none smtp.client-ip=209.85.128.45 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="gMkju6jn" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-483a2338616so34285115e9.0 for ; Tue, 03 Mar 2026 02:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772534581; x=1773139381; 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=4rYJKiRZStgtdNIAFVyZbjIj2ylSq5foITnYd7+iw20=; b=gMkju6jn5rp8EsuP1kV1wylE6WvRTVOAs/R8HIGAlpkvJ+zGfeKuGPgFdqo+bOFyEH hgF4OxFLggvn4kikBz19wuuXh7JsfPt/9neWClEVzKCI3IxQ3t9/qnfGzyCr7HkafbIz D/Bm/SrJU3dbW5269+0Rm4wGfMC2ddkiIGJoeMiDC0nOJvVV5jvbad0jJVU+oT1Tqw4i TUjl820QmAaxgwnKZG3NZMAlB/PLT/ukBa8PINyKYVSaJ+HEZ9qIzDe8pqB21Y0MSXfk ua+EiRksHafUPtTu6WNLEDSbOoj2gteryc/CQuJyHmJ5OcBbqQwEe4m/IYgiq8ukQE89 DWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772534581; x=1773139381; 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=4rYJKiRZStgtdNIAFVyZbjIj2ylSq5foITnYd7+iw20=; b=HQkKFHiAATFD9oZwnvzfuRXQE+9C0TnzFN7Ha2TxBVUTJ29hh4j1Cb6yi+wcxH83O9 pTn21HjAa4NKg6/WHhJa/mOiHVFJ0bZlFzD7qzDXdxXBSgF+QU7Vv2Nd96zuopyL1gWx r85CkoLrzhM80b5BgDH+Q6FGJGE5l81rgNXjvSA51yCLMPWLe0etHclnHvTPnVD74hnr Kp8HG5sXPcOKMhHCjG8SfHmuSRpQcXD3sY2EbdyCKal2GMVEg+avYxsDq1GQSzXperKI SRaAJv5tjgzXfZgTXqRYESg3T4KVvo6PrfIC6qQO1/ke34tLxtuvsf5rj52yh6M5qDgh WE3g== X-Forwarded-Encrypted: i=1; AJvYcCVIyQIWoz/NZFosfrsTnBcnAtpuIvpnzDKcWD7BfI7qaP6w5jRoo1FkPhE2XxXdGOUbcnjibjdG5I28PAw=@vger.kernel.org X-Gm-Message-State: AOJu0YwIj5DDlQ0h5uZMbrLKxovVSvU8/rY5oQPRU2SmYdTLaiYFHSNo S1E28bE4qGtqBLOA2+AEBQYGKrP4Y9YahTJTua6LSZd6QzW/h6l97haH X-Gm-Gg: ATEYQzz64msbIvj2T4iAOgbLNcdkWZ8D6xkZpUeutATE+1qCO0hd9eA84vH5+J4lB04 6eFiSb/pGgV3zc4HG8MNOuhkNdhow9JSMpBRzrjGSPy0ZGdNQ6FQZYvRhJF9larLJ3F0L0bZ6rr Tbaz3Wo9xvD929M+erXHWoHSWh+N6U4IrKvuu45XUwNiKcyZd3Jm9UJoowoB3k/HFUqDObIPfMe 0GidMCLK2Z2WAb4lWu9bCendM19gPjvJ6h/vRsy8ahCuIbx28NAcHoHcyZA5481s8gL1WmN5Fv0 OcjGGpIyIMKKFgOtnUzICa9gyts2wwMC5Aj/cmVYwO8hxmPwWGrw17nbq8JHqgU7oOopSQ3dLCc qsmmckSiJhN4qGhMUzFsb5lJU5XD1x1wF6ybm4MhM2vDL6KB72PjOuTzbIlFJwWgfV0Wf4RFyMR HsobBHu3X9PwopZlerW/dCy8GG7KhrK99rU+3laaicwVLFXR1h480Pao9b9KU6zCCn0yXARG7eD 4t1Dl/sg+8bl3+wua5z3i/QMFXkq2yv8K4i X-Received: by 2002:a05:600c:b90:b0:483:456a:514b with SMTP id 5b1f17b1804b1-483c9bb1fbfmr279336355e9.12.1772534580446; Tue, 03 Mar 2026 02:43:00 -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-4851266e10asm14242405e9.4.2026.03.03.02.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 02:42:59 -0800 (PST) From: Tommaso Cucinotta X-Google-Original-From: Tommaso Cucinotta To: Peter Zijlstra Cc: Tommaso Cucinotta , 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 11:41:55 +0100 Message-ID: <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it> X-Mailer: git-send-email 2.45.2 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 sc= hed_getattr() to retrieve, for DEADLINE tasks, the runtime left and absolut= e deadline (setting the flags syscall parameter to 1), in addition to the s= tatic 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..03970cc8 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