<table><tr><td style="">jpalecek created this revision.<br />jpalecek added reviewers: ahiemstra, davidedmundson.<br />Herald added a project: Plasma.<br />jpalecek requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29615">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Setting process priorities by ksysguard has the flaw that it only<br />
 sets priority of a single thread of a multithreaded program. For<br />
 example, if I want to put handbrake encoding to the background, it<br />
 usually fails as other threads from the same process continue to hog<br />
 the CPU. This patch changes the behavior by attempting to change the<br />
 priority of all threads (on Linux).</p>

<p>There is a caveat: when the threads' priorities were previously<br />
 different, it may mean you change the priority against the logic of<br />
 the application. For example some background threads of an<br />
 application might end up having the same priority as the<br />
 foreground. As a corollary, the call may mean lowering priority of<br />
 some threads, but raising it for others and thus fail due to<br />
 insufficient capabilities. Still, I think this behavior is actually<br />
 the only one usable, until we have individual threads in<br />
 ksysguard. Even then, I doubt people will look at the individual<br />
 threads when renicing. Till then, the ability to renice a task is a<br />
 need which ksysguard should fulfill, but unfortunately doesn't.</p>

<p>Note: this only changes the behavir for remote computers. Local use<br />
 needs a similar fix in libksysguard.</p></div></div><br /><div><strong>TEST PLAN</strong><div><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">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</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R106 KSysguard</div></div></div><br /><div><strong>BRANCH</strong><div><div>Plasma/5.18</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29615">https://phabricator.kde.org/D29615</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>ksysguardd/Linux/ProcessList.c</div></div></div><br /><div><strong>To: </strong>jpalecek, ahiemstra, davidedmundson<br /><strong>Cc: </strong>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<br /></div>