Bug 177809 - glibc-headers uses SCHED_OTHER while kernel uses SCHED_NORMAL
glibc-headers uses SCHED_OTHER while kernel uses SCHED_NORMAL
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-01-14 09:50 EST by Oleg Goldshmidt
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-14 11:09:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Oleg Goldshmidt 2006-01-14 09:50:51 EST
Description of problem:

The <bits/sched.h> from glibc, and the man pages at least for
sched_{get,set}scheduler(2) use SCHED_OTHER for the default process scheduling
policy. In the kernel (<linux/sched.h> in 2.6.14, 2.6.15 from Fedora updates)
the symbolic name was changed to SCHED_NORMAL. 

This does not cause a real problem yet because in both cases the macro is
expanded to 0. However, it is inconsistent, confusing, and potentially dangerous.

It should be trivial to fix in every single case, but I think RedHat/Fedora
should decide how to approach it system-wide. There may be other apps (e.g.
mozilla) that use SCHED_OTHER as well. I suppose userspace should follow the
kernel on this.

Version-Release number of selected components (on my system):

Fedora Core release 4 (Stentz)
Linux 2.6.15-1.1823_FC4smp x86_64

How reproducible:

Looking at the code and man pages.
Steps to Reproduce:
1. grep (or look at) the kernel sources, namely <linux/sched.h> for
2. grep the system headers, namely <bits/sched.h> for same
3. look at (or grep) the relevant man pages (sched_getscheduler(2),
Actual results:

$ egrep -A2 "^#define[ \t]+SCHED_(OTHER|NORMAL)"
#define SCHED_NORMAL            0
#define SCHED_FIFO              1
#define SCHED_RR                2
$ egrep -A2 "^#define[ \t]+SCHED_(OTHER|NORMAL)"
#define SCHED_NORMAL            0
#define SCHED_FIFO              1
#define SCHED_RR                2
$ egrep -A2 "^#define[ \t]+SCHED_(OTHER|NORMAL)" /usr/include/bits/sched.h
#define SCHED_OTHER     0
#define SCHED_FIFO      1
#define SCHED_RR        2
$ man sched_getscheduler | col -b | egrep "SCHED_(OTHER|NORMAL)"
       SCHED_RR, and SCHED_OTHER; their  respective  semantics  are  described
       SCHED_OTHER is the default universal time-sharing scheduler policy used
       uled with SCHED_OTHER must be assigned the static priority 0, processes
       preempt immediately any currently running normal  SCHED_OTHER  process.
   SCHED_OTHER: Default Linux time-sharing scheduling
       SCHED_OTHER  can only be used at static priority 0.  SCHED_OTHER is the
       fair progress among all SCHED_OTHER processes.

Expected results:

SCHED_NORMAL used instead of SCHED_OTHER, consistently with the kernel

Additional info:

I queried the Bugzilla for SCHED_NORMAL in comments, found nothing.
Comment 1 Jakub Jelinek 2006-01-14 11:09:40 EST
SCHED_OTHER is the name POSIX requires:
so glibc headers must not change.

Note You need to log in before you can comment on or make changes to this bug.