Bug 146905 - adjusted/adjusteable priorities per application
Summary: adjusted/adjusteable priorities per application
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeinit (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-18 09:27 UTC by Arne Babenhauserheide
Modified: 2024-05-10 20:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arne Babenhauserheide 2007-06-18 09:27:32 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
OS:                Linux

I think it might be nice, if kdeinit didn't start most processes at niceness 0, but would assign different priorities to processes according to their "importance" (for example in the range from 0 to 5). 

(I hope kdeinit is the correct topic for this bug. Or should it go to useability instead? Or somewhere else?)

For example, kwin should just keep working when some process in a Konqueror-Plugin goes nuts and tries to consume 100% system load, so kwin should have a higher priority than Konqueror. 

Also alt-F2 should always produce a quick response, even while I torture my computer with some beta or alpha app which tumbles into a loop. 

Less critical applications could be adjusted to priority 2-4, so there's still space for special cases. 

As a rule of thumb, I think that applications which provide support when some other application goes crazy should be priority 0, so I can always access them. 
For example my keyboard-shortcuts should always work, as should alt-F2. 
And when kwin freezes, other tasks are not very useful, too, so it should also be priority 0, I think. 

After those I'd locate applications where stuttering creates serious discomfort for the user, for example multimedia-programs like amarok and kaffeine. Also full-screen applications which are normally used exclusively could get priority 1 (for example games with sound and music, which normally won't disrupt other running media, because users normally stop other media before playing them). 

All other applications could circle around priority 3. Important applications (those which make KDE look bad, if they stutter) with priority 2 and a bit less important ones with priority 4. 

Maybe those could even be adjusted dynamically, so that the frontmost applications gets priority 2 while applications on another desktop get priority 4. 

Personally I'd love to see and use it. 

We have this great niceness system, and I often think "why isn't it utilized far more extensively?"

Is there something I don't see, which makes this idea impossible or useless? 

Best wishes and thanks for your work! 
Arne
Comment 1 Christoph Feck 2009-10-07 01:56:00 UTC
The problem is when KDE apps run with priority 1 (or even nicer), and non-KDE applications that are usually priority 0 steal their time you gain nothing. Actually important things should run with priority -1, but that requires root privileges.
Comment 2 Arne Babenhauserheide 2009-10-07 08:18:17 UTC
The second problem I now found is, that renice can increase the priority of a process, but never lower it. 

A scenario which I thought would work (but was proven wrong): 

- Konsole starts with prio 0
- I now renice Kontact (and everything else in KDE) to prio 5
- Then when I want Kontact in the foreground, I renice it to prio 0

result: 

$ renice -n 5 `pgrep kontact`
12150: Alte Priorität: 0, neue Priorität: 5
$ LANG=C renice -n 0 `pgrep kontact`
renice: 12150: setpriority: Permission denied

So adjusting permissions on the fly doesn't seem possible with renice. I don't know if there's a better tool which can lower the priority to the nicelevel of the shell which calls renice. 


What I would gain if it was possible is that when I only use KDE apps, KDE could do on the fly priority assignment. For example the foreground program could always be more important that the background programs. 

With the renice limitation the only thing which can be done is to call all processes with a lower priority which aren't time critical. 

This is for example what I do in my Gentoo: When I install programs, the compiling is done at nicelevel 10 (there's a setting in the config for that), so compiling in the background doesn't really bother me - I can simply ignore it.
Comment 3 Christoph Cullmann 2024-05-10 20:34:21 UTC
We removed kdeinit in KF6.