Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks

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>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260304102843.1373905-2-tommaso.cucinotta@santannapisa.it>

authored by

Tommaso Cucinotta and committed by
Jonathan Corbet
b8e7e033 17eb360d

+15 -4
+15 -4
Documentation/scheduler/sched-deadline.rst
··· 628 628 * the new scheduling related syscalls that manipulate it, i.e., 629 629 sched_setattr() and sched_getattr() are implemented. 630 630 631 - For debugging purposes, the leftover runtime and absolute deadline of a 632 - SCHED_DEADLINE task can be retrieved through /proc/<pid>/sched (entries 633 - dl.runtime and dl.deadline, both values in ns). A programmatic way to 634 - retrieve these values from production code is under discussion. 631 + The leftover runtime and absolute deadline of a SCHED_DEADLINE task can be 632 + read using the sched_getattr() syscall, setting the last syscall parameter 633 + flags to the SCHED_GETATTR_FLAG_DL_DYNAMIC=1 value. This updates the 634 + runtime left, converts the absolute deadline in CLOCK_MONOTONIC reference, 635 + then returns these parameters to user-space. The absolute deadline is 636 + returned as the number of nanoseconds since the CLOCK_MONOTONIC time 637 + reference (boot instant), as a u64 in the sched_deadline field of sched_attr, 638 + which can represent nearly 585 years since boot time (calling sched_getattr() 639 + with flags=0 causes retrieval of the static parameters instead). 640 + 641 + For debugging purposes, these parameters can also be retrieved through 642 + /proc/<pid>/sched (entries dl.runtime and dl.deadline, both values in ns), 643 + but: this is highly inefficient; the returned runtime left is not updated as 644 + done by sched_getattr(); the deadline is provided in kernel rq_clock time 645 + reference, that is not directly usable from user-space. 635 646 636 647 637 648 4.3 Default behavior