i'm working on a redhat 8 linux and i want to add new policy for scheduling the processes , could you help me with :
1) where to define the new policy
2) how does the process of assigning a policy for a process goes?

detailing function names and structs would be helpful .

link|improve this question
see linux.die.net/man/2/sched_setscheduler – Eroen Dec 14 '11 at 15:22
feedback

migrated from superuser.com Dec 14 '11 at 22:49

This question came from our site for computer enthusiasts and power users.

1 Answer

You're referring to Red Hat version 8.0, running a 2.4-series kernel?? That version was end-of-life back in 2003 or 2004. I don't believe the realtime scheduling policies are available in any kernel prior to 2.6.x, based on the link provided in the first comment on the post.

Edit: The kernel in use is actually a 2.6.x kernel. The command needed to make this work is chrt. In this case, it will need to be backported or compiled from scratch for the Red Hat 8.0 server. I suspect you'll run into other issues doing so, but for anyone else who stumbles upon this, chrt allows this.

From the man page:

NAME
       chrt - manipulate real-time attributes of a process

SYNOPSIS
       chrt [options] [prio] [pid | command [arg]...]

DESCRIPTION
       chrt(1)  sets or retrieves the real-time scheduling attributes of an existing PID or runs COMMAND
       with  the  given  attributes.   Both  policy  (one  of  SCHED_OTHER,  SCHED_FIFO,  SCHED_RR,   or
       SCHED_BATCH) and priority can be set and retrieved.

A real example:

# Set JSINIT processes for e-commerce to FIFO scheduler and realtime priority 75.
for i in `pgrep -f 'JSINIT\ I.*' | xargs`; do chrt -p -f 75 $i; done
link|improve this answer
yes i know , but it is a custom kernel with the scheduling policies from kernel 2.6.x – saeed hardan Dec 15 '11 at 16:17
The userspace command you need in order to change application scheduling is chrt. You would need to backport it into the RH8.0 system. – ewwhite Dec 15 '11 at 16:28
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.