-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The Friday 2007-12-14 at 19:12 -0000, David wrote:

On Fri, 14 Dec 2007 18:28:19 -0000, Jason Craig <[EMAIL PROTECTED]> wrote:
I looked into the topic for a bit, what I was "needing" the RT kernel for was audio recording/processing. Normal users can't run threads in "realtime" priority, the super user can, but then running general applications as the superuser is not really the best idea.

Just an idea... would it be possible to re-nice the program you are using?

There is a problem.

First, it is not renice what you are looking at, but ionice - from the manual:

       This program sets the io scheduling class and pri‐
       ority  for  a  program.  As of this writing, Linux
       supports 3 scheduling classes:

       Idle.  A program running  with  idle  io  priority
       will  only get disk time when no other program has
       asked for disk io for a defined grace period.  The
       impact  of  idle  io  processes  on  normal system
       activity should be  zero.  This  scheduling  class
       does not take a priority argument.

       Best effort.  This is the default scheduling class
       for any process that hasn't asked for  a  specific
       io priority. Programs inherit the CPU nice setting
       for io priorities. This  class  takes  a  priority
       argument  from 0-7, with lower number being higher
       priority. Programs running at the same best effort
       priority are served in a round-robin fashion.

       Real time.  The RT scheduling class is given first
       access to the disk, regardless  of  what  else  is
       going on in the system. Thus the RT class needs to
       be used with some care, as  it  can  starve  other
       processes. As with the best effort class, 8 prior‐
       ity levels are defined denoting  how  big  a  time
       slice   a  given  process  will  receive  on  each
       scheduling window.

Now, you can call a program like this:

ionice -c1 program args

to give it realtime priority. However... ionice has to be run as root. If you call it being user, through sudo, the effective user of the child program is still root - and this is not what we want and need.

The alternative method is to use "ionice -c1 -p PROGRAM_PID" instead, which can be set to be used through sudo, but you need to know the PID of the process you want to modify the priority. And if it has children, them too.

But! Some programs try to detect at start if they have realtime priorities... if they are given them later by the method described, it is already to late for them, they will not use the alternative algorithms designed for that case. I believe Xine does this.


So, yes, a method to give a group of programs realtime priority from the start would be interesting.


- -- Cheers,
       Carlos E. R.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQFHYtintTMYHG2NR9URArzoAJ9NFZwJoIK7O0dUUHLEsapvpaKo3ACfQ3qT
3EAoDpIRVnJ5KulOb1iavZ0=
=YrIk
-----END PGP SIGNATURE-----

Reply via email to