sched






sched,resched,getsched ‐ change a process’
scheduler/priority



     sched [‐h] [‐v] ‐r|‐o|‐f priority program [args, ..]

     resched [‐h] [‐v] ‐r|‐o|‐f pid [priority]

     getsched [‐h] pid [pid, ...]

schedutils are some utilities used to manipulate the
scheduling and priority of processes on *nix  systems. This
is realized with the functions found in sched.h, see the
manpage for sched_setscheduler(2) for more info about what’s
going on.

sched runs a new program under the specified scheduler and
priority, resched is used to change the scheduler and/or
priority of already running processes identified with their
pid.  getsched is a little utility that prints the scheduler
and priority of running processes identified with their pid,
it does not alter anything. Usually only the superuser(root)
are allowed to change scheduling parameters.

‐h print help

     ‐v be verbose, prints out the  scheduler/priority
before and after it’s changed.

     ‐r Round Robin scheduler

     ‐f FIFO scheduler

     ‐o Other scheduler, this is the ’default’ scheduler
that normal processes start under.

The scheduler is the part of the kernel that decides which
process that will get the CPU next. Posix defines three
diffrent policies that can be used to decide this.  See
sched_setscheduler for an in‐depth explanation for the
platform you use.

     Other the default timesharing scheduler used by normal
processes. The ’Other’ scheduler uses the lowest priority 0
, and  it cannot be set higher.

     FIFO First In First Out must have a priority in the
range 1‐99 and uses a simple fifo queue to hold the
processes A process that is executed will continue to
execute until it’s either preempted by a process with higher
priority, gives up the CPU (e.g. by calling sched_yield) or
performs a call that blocks. Then then next process in the
queue can run.









                             ‐2‐


     Round Robin must have a priority in the range 1‐99 and
are very similar to FIFO, except it uses timesharing between
the processes in the queue, a running process will therefore
give up the CPU to another process with the same priority
when it has used its time quantum.

When a process is run under another scheduler than the
default (Other) it can never be preempted by a process with
a lower priority. So, if a process run under another
scheduler uses the CPU heavily, or worse have e.g. a bug
that causes it to go in an infinite loop, no other process
might ever run and the machine might look completely locked,
unless there is an open shell running somewhere with a even
higher priority, one can execute commands and possibly kill
the process.

None known, report any you find to
http://sourceforge.net/tracker/?atid=399898&group_id=30636&func=browse

Nils O. Selåsdal <NOS@Utel.no>

nice(1),renice(8),sched_setscheduler(2),sched_getscheduler(2)