Bug 1390546

Summary: SCHED_DEADLINE missing from 'sched_setscheduler' man page
Product: [Fedora] Fedora Reporter: Daniel Berrangé <berrange>
Component: man-pagesAssignee: Nikola Forró <nforro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: jchaloup, mtk.manpages, nforro
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: man-pages-4.06-3.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-15 23:32:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Daniel Berrangé 2016-11-01 11:15:19 UTC
Description of problem:
/usr/include/linux/sched.h listed 6 scheduler constants

#define SCHED_NORMAL            0
#define SCHED_FIFO              1
#define SCHED_RR                2
#define SCHED_BATCH             3
/* SCHED_ISO: reserved but not implemented yet */
#define SCHED_IDLE              5
#define SCHED_DEADLINE          6


but 'man sched_setscheduler' only lists 5 of them

       SCHED_OTHER   the standard round-robin time-sharing policy;

       SCHED_BATCH   for "batch" style execution of processes; and

       SCHED_IDLE    for running very low priority background jobs.

       SCHED_FIFO    a first-in, first-out policy; and

       SCHED_RR      a round-robin policy.

It is missing SCHED_DEADLINE

Version-Release number of selected component (if applicable):
man-pages-4.06-2.fc25.noarch

Comment 1 Daniel Berrangé 2016-11-01 14:33:06 UTC
Ok, it turns out that you can't use SCHED_DEADLINE in combination with sched_setschedular, because you need to provide various attributes atomically with the setting of the schedular. Thus you must use sched_setattr instead.

It would be desirable for the sched_setaffinity to direct devs to the sched_setattr method for SCHED_DEADLINE, rather than just pretending it doesn't exist.

Comment 2 Michael Kerrisk 2016-12-10 09:39:33 UTC
> It would be desirable for the sched_setaffinity to direct devs to the

s/sched_setaffinity/sched_setscheduler/ (presumably).

> sched_setattr method for SCHED_DEADLINE, rather than just pretending it
> doesn't exist.

I'd encourage you to think a little about your phrasing. No one/nothing is "pretending" anything. To phase it that way carries rather negative connotations.

Anyway, for upstream man-pages-4.09, I have applied the following patch.

Thanks,

Michael

--- a/man2/sched_setscheduler.2
+++ b/man2/sched_setscheduler.2
@@ -171,8 +171,13 @@ POSIX.1-2001, POSIX.1-2008 (but see BUGS below).
 The \fBSCHED_BATCH\fP and \fBSCHED_IDLE\fP policies are Linux-specific.
 .SH NOTES
 Further details of the semantics of all of the above "normal"
-and "real-time" scheduling policies can be found in
-.BR sched (7).
+and "real-time" scheduling policies can be found in the
+.BR sched (7)
+manual page.
+That page also describes an additional policy,
+.BR SCHED_DEADLINE ,
+which is settable only via
+.BR sched_setattr (2).
 
 POSIX systems on which
 .BR sched_setscheduler ()

Comment 3 Nikola Forró 2016-12-13 11:15:22 UTC
Thanks Michael,

patch backported to F25:
http://pkgs.fedoraproject.org/cgit/rpms/man-pages.git/commit/?h=f25&id=fe6a825e32e452212a31c8d6c9b4a8c270ff84ad

Comment 4 Fedora Update System 2016-12-13 11:16:59 UTC
man-pages-4.06-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b7694f007e

Comment 5 Fedora Update System 2016-12-14 02:24:14 UTC
man-pages-4.06-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b7694f007e

Comment 6 Fedora Update System 2016-12-15 23:32:08 UTC
man-pages-4.06-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2016-12-16 00:26:53 UTC
man-pages-4.06-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.