D29615: Nice all threads of multithreaded programs

Jiří Paleček noreply at phabricator.kde.org
Mon May 11 02:45:39 BST 2020


jpalecek created this revision.
jpalecek added reviewers: ahiemstra, davidedmundson.
Herald added a project: Plasma.
jpalecek requested review of this revision.

REVISION SUMMARY
  Setting process priorities by ksysguard has the flaw that it only
   sets priority of a single thread of a multithreaded program. For
   example, if I want to put handbrake encoding to the background, it
   usually fails as other threads from the same process continue to hog
   the CPU. This patch changes the behavior by attempting to change the
   priority of all threads (on Linux).
  
  There is a caveat: when the threads' priorities were previously
   different, it may mean you change the priority against the logic of
   the application. For example some background threads of an
   application might end up having the same priority as the
   foreground. As a corollary, the call may mean lowering priority of
   some threads, but raising it for others and thus fail due to
   insufficient capabilities. Still, I think this behavior is actually
   the only one usable, until we have individual threads in
   ksysguard. Even then, I doubt people will look at the individual
   threads when renicing. Till then, the ability to renice a task is a
   need which ksysguard should fulfill, but unfortunately doesn't.
  
  Note: this only changes the behavir for remote computers. Local use
   needs a similar fix in libksysguard.

TEST PLAN
    Run a multithreaded process which uses the CPU (like video coding)
    Set its priority to low
    Check with ps -p $pid -L o pid,lwp,pri,comm

REPOSITORY
  R106 KSysguard

BRANCH
  Plasma/5.18

REVISION DETAIL
  https://phabricator.kde.org/D29615

AFFECTED FILES
  ksysguardd/Linux/ProcessList.c

To: jpalecek, ahiemstra, davidedmundson
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200511/a064fb30/attachment.htm>


More information about the Plasma-devel mailing list