2

I am searching for an document or related to Processes Priority levels.

In Linux, related documentation does not talk about priority levels or Priority classes. It only provides the range of nice values.

User can set any value within that range. Kernel provides min and max limits for priority.

Currently “GNOME System Monitor” shows Process Priority names like “ Very High , High , Normal , Low , Very low ” and each one has own nice value range.

I haven't found any documentation related to these names as such.

In 2004, A bug was raised in “GNOME.org” against “GNOME System Monitor” Bug 131802.

The bug describes that “GNOME System Monitor” should not make references to "nice." nice has confusing semantics, mostly due to lower values being higher priority.

In 2011, A The patch adds a priority column in the process table to show the nice value in a human-understandable way, and show it by default.

I refered the https://bug131802.bugzilla-attachments.gnome.org/attachment.cgi?id=202180

And referd function “get_nice_level()” in the source code for “gnome-system-monitor”.

Below is the function template from the same file.

static gchar *
get_nice_level (gint nice)
{
        if (nice < -7)
                return _("(Very High Priority)");
        else if (nice < -2)
                return _("(High Priority)");
        else if (nice < 3)
                return _("(Normal Priority)");
        else if (nice < 7)
                return _("(Low Priority)");
        else
                return _("(Very Low Priority)");
}

These are my questions:

  1. The values defined by / for GNOME System Monitor, they are that tool specific ?

  2. Is Gnome System Monitor is actually putting a process to that priority ? Is Kernel also treat that process in that priority which is changed in Gnome System Monitor?

  3. Is there any where i can find that these are the newly defined priority classes for different priority levels? Is this classes used across all the Distributions.?

Thanks. Shri Hari.

  • You might be able to get more detailed answers over on the gnome-devel mailing list mail.gnome.org/archives/gnome-devel-list – Kevin Bowen Jun 7 '13 at 13:00
  • 1
    These terms ("high", "very high", etc) are just used by GNOME for presentation purposes. The standard -20 to 19 Linux process priorities ("niceness") still apply. Note that processes have both CPU priority (set with nice) and IO priority (set with ionice). The semantics of the latter are more complex. – chronitis Jun 7 '13 at 13:15
  • Indeed, it seems a bit short-sighted to have obfuscated this in Gnome system monitor, given the length of time nice values have been around. – belacqua Jun 7 '13 at 23:03
2

Each process influences kernel's scheduling by its nice value. These values are from a range of -20 (high priority) to +19 (low) priority, with 0 being (default), so regarding function's template and your first question, the answer is no they are not tool specific.

Linux uses the same priorities for every process. However if you invoke getpriority() system call you will get different values (from 1 to 40), this is done on purpose to avoid returning negative values.

There is a very good book you may refer to: Michael Kerrisk's "The Linux Programming Interface", published at 2010.

References: Kernel's scheduler's nice design

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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