public inbox for linux-api@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks
       [not found] <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it>
@ 2026-03-03 18:42 ` Tommaso Cucinotta
  2026-03-03 23:20   ` Randy Dunlap
  2026-03-04 10:28 ` [PATCH v2] " Tommaso Cucinotta
  1 sibling, 1 reply; 5+ messages in thread
From: Tommaso Cucinotta @ 2026-03-03 18:42 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Tommaso Cucinotta, linux-api, Juri Lelli, Jonathan Corbet,
	Shuah Khan, Shashank Balaji, linux-doc, linux-kernel

Document in Documentation/sched/sched-deadline.rst the new capability of
sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absolute
deadline (setting the flags syscall parameter to 1), in addition to the static
parameters (obtained with flags=0).

Signed-off-by: Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
---
 Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/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.
 
- For debugging purposes, the leftover runtime and absolute deadline of a
- SCHED_DEADLINE task can be retrieved through /proc/<pid>/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=1 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_attr,
+ which can represent nearly 585 years since boot time (calling sched_getattr()
+ with flags=0 causes retrieval of the static parameters instead).
+
+ For debugging purposes, these parameters can also be retrieved through
+ /proc/<pid>/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.
 
 
 4.3 Default behavior

base-commit: f74d204baf9febf96237af6c1d7eff57fba7de36
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks
  2026-03-03 18:42 ` [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks Tommaso Cucinotta
@ 2026-03-03 23:20   ` Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2026-03-03 23:20 UTC (permalink / raw)
  To: Tommaso Cucinotta, Peter Zijlstra
  Cc: Tommaso Cucinotta, linux-api, Juri Lelli, Jonathan Corbet,
	Shuah Khan, Shashank Balaji, linux-doc, linux-kernel

This patch should be marked as v2, with the differences between
v1 and v2 described.



On 3/3/26 10:42 AM, Tommaso Cucinotta wrote:
> Document in Documentation/sched/sched-deadline.rst the new capability of
> sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absolute
> deadline (setting the flags syscall parameter to 1), in addition to the static
> parameters (obtained with flags=0).
> 
> Signed-off-by: Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>
> Acked-by: Juri Lelli <juri.lelli@redhat.com>
> ---
>  Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/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.
>  
> - For debugging purposes, the leftover runtime and absolute deadline of a
> - SCHED_DEADLINE task can be retrieved through /proc/<pid>/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=1 value. This updates the

About the build warning due to the use of  `flags':
If you want smart quotes, just use 'flags'.
If you want italics, use           `flags`.
If you want a code-look (monotype), use ``flags``.

> + 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_attr,
> + which can represent nearly 585 years since boot time (calling sched_getattr()
> + with flags=0 causes retrieval of the static parameters instead).
> +
> + For debugging purposes, these parameters can also be retrieved through
> + /proc/<pid>/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.
>  
>  
>  4.3 Default behavior
> 
> base-commit: f74d204baf9febf96237af6c1d7eff57fba7de36

-- 
~Randy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks
       [not found] <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it>
  2026-03-03 18:42 ` [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks Tommaso Cucinotta
@ 2026-03-04 10:28 ` Tommaso Cucinotta
  2026-03-04 10:28   ` Tommaso Cucinotta
  1 sibling, 1 reply; 5+ messages in thread
From: Tommaso Cucinotta @ 2026-03-04 10:28 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Tommaso Cucinotta, linux-api, Jonathan Corbet, Shuah Khan,
	Juri Lelli, Shashank Balaji, linux-doc, linux-kernel


Compared to the initially submitted documentation patch, this
version addresses the issue highlighted by Juri of the wrong wrapping
of the commit message, and the one found by the chatbot of the wrong
use of quotes around the flags parameter. I'm also adding "v2" in
the subject line, as requested by Randy.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks
  2026-03-04 10:28 ` [PATCH v2] " Tommaso Cucinotta
@ 2026-03-04 10:28   ` Tommaso Cucinotta
  2026-03-09 16:17     ` Jonathan Corbet
  0 siblings, 1 reply; 5+ messages in thread
From: Tommaso Cucinotta @ 2026-03-04 10:28 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Tommaso Cucinotta, linux-api, Juri Lelli, Jonathan Corbet,
	Shuah Khan, Shashank Balaji, linux-doc, linux-kernel

Document in Documentation/sched/sched-deadline.rst the new capability of
sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absolute
deadline (setting the flags syscall parameter to 1), in addition to the static
parameters (obtained with flags=0).

Signed-off-by: Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
---
 Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/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.
 
- For debugging purposes, the leftover runtime and absolute deadline of a
- SCHED_DEADLINE task can be retrieved through /proc/<pid>/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=1 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_attr,
+ which can represent nearly 585 years since boot time (calling sched_getattr()
+ with flags=0 causes retrieval of the static parameters instead).
+
+ For debugging purposes, these parameters can also be retrieved through
+ /proc/<pid>/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.
 
 
 4.3 Default behavior

base-commit: f74d204baf9febf96237af6c1d7eff57fba7de36
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks
  2026-03-04 10:28   ` Tommaso Cucinotta
@ 2026-03-09 16:17     ` Jonathan Corbet
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2026-03-09 16:17 UTC (permalink / raw)
  To: Tommaso Cucinotta, Peter Zijlstra
  Cc: Tommaso Cucinotta, linux-api, Juri Lelli, Shuah Khan,
	Shashank Balaji, linux-doc, linux-kernel

Tommaso Cucinotta <tommaso.cucinotta@gmail.com> writes:

> Document in Documentation/sched/sched-deadline.rst the new capability of
> sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absolute
> deadline (setting the flags syscall parameter to 1), in addition to the static
> parameters (obtained with flags=0).
>
> Signed-off-by: Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>
> Acked-by: Juri Lelli <juri.lelli@redhat.com>
> ---
>  Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-09 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it>
2026-03-03 18:42 ` [PATCH] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks Tommaso Cucinotta
2026-03-03 23:20   ` Randy Dunlap
2026-03-04 10:28 ` [PATCH v2] " Tommaso Cucinotta
2026-03-04 10:28   ` Tommaso Cucinotta
2026-03-09 16:17     ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox