Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 .

share|improve this question

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

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

    
see linux.die.net/man/2/sched_setscheduler –  Eroen Dec 14 '11 at 15:22

1 Answer 1

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
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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