Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    "ps" does not give nice value of process if realtime priority set...

    I'm using a realtime-enabled kernel, and I noticed that when I do the command:
    ps axo pid,nice,rtprio,comm
    It does not print the nice value for a process if the process has a realtime value. If I "renice" a process that has a realtime value set, renice will give the old nice value as well as the new value being set, so I know that the nice value doesn't seem to be lost just by setting the realtime priority. Also, the correct nice value is also displayed in ksysguard for example.

    So why doesn't the ps command above display the nice value for realtime prioritized processes?

    I'm wondering if maybe the crucial question to ask first is--does the nice value matter if the process has a realtime priority? In other words, does a process with a realtime priority (even the lowest realtime priority) always take precedence over other processes that may have a nice value of -20 (highest nice priority)? Is that why the ps command above doesn't give a nice value for realtime prioritized processes? Thanks for any help.

  2. #2
    Linux Newbie SagaciousKJB's Avatar
    Join Date
    Aug 2007
    Yakima, WA
    I don't know the specifics about how ps works, but I know that when I use the "ionice" command it kind of behaves like that. It switches it ( the process ) off of the "nice" scheduler and on to the real-time one, so maybe, and It's a total stab in the dark, "ps" is trying to read the nice value from the process itself, and perhaps "renice" and "ksysguard" are reading values stored in /proc/.

    Oh, I don't know if "ionice" is the program you're using, but I know that the scheduler it uses ( I think whatever one is usually used in real-time kernels, I'm not really well-versed on the subject ) supersedes the "nice" one.

  3. #3
    I tried "ionice -p <pid>" and it seems to return a nice value of 0 regardless of how I set the nice value of the process with renice. I did a search through /proc/<pid> for the correct nice value and didn't find anything either. Thanks for the reply, but I guess I'm still confused since I don't know where ksysguard (for example) is getting its nice value for a process when ps/ionice won't display it.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts