I've noticed that when running at 100%, things like GNOME become less responsive until I kill background tasks that are expected to take a long time, like compilation or downloading email. Why doesn't the linux kernel give programs requiring real time responsiveness higher priority?

I'm running kernel version 4.0 on a fresh install of Fedora, by the way.

  • Why are interactive programs more important than "background tasks"? What if those background tasks include live server activities -- then what should be prioritized? It's up to the user to make those decisions and configure (and use) the system appropriately. Your question should really be, "How can I get the system to prioritize the tasks I want prioritized?" – goldilocks Jul 7 '15 at 11:22

I believe it actually does prioritize interactive-programs -- but perhaps not enough. Programs looses priority the longer they run, and non-interactive programs looses it quicker than interactive ones.

You really shouldn't operate at close to 100% CPU-usage, if you do, perhaps you should review some things...

There are two things that impact the priority given to a program -- intial nice-value and the schedueler used. nice lets you down-prioritize some programs (e.g. a heavy compiling job). root may also give programs higer priority with nice. The scheduler decides both how much a program can "hog" the CPU, and when it can preempt other processes. Here a process can be given "real-time" priority, meaning it run before anything else.

The problem is that you don't know what's hogging your system. Perhaps GNOME is slow because it must wait for some sub-process that must wait on a disk... perhaps your graphic-card doesn't cooperate, so GNOME must use software-rendering of graphics... Because just giving GNOME a better nice-value and/or a different scheduling-policy, may make your system even slower, since what GNOME is waiting for (e.g. disk-access) now may be preempted by GNOME and thus run even slower than before.

Once you've found-out where the problem is, you may try giving X and/or GNOME a bit better nice and/or scheduling... but don't go full-hog -- for example there are important system daemons that runs with nice-values of just -5 or -10 (negative-values = higher/better priority), that probably shouldn't be preempted by you suddenly giving GNOME a nice-value of -18.

  • It might be easier to start whatever low priority background tasks cause the problem (e.g. compilers will use as much as they can) with a high nice value, giving everything else higher priority. – goldilocks Jul 7 '15 at 11:27
  • Lose is spelled l-o-s-e – Rob Jul 7 '15 at 11:39

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.