Sample Header Ad - 728x90

Renicing X server and compositing manager (kwin-like) on a linux_kernel desktop

0 votes
0 answers
123 views
- Long time ago (pre-2.6 kernels) on a very low end desktop, I had been happily following Con Kolivas suggestion to (quite heavily (-10)) renice the X server. (for better responsiveness) - With newer kernels, newer scheduler and smp systems, many had reported that even a 1 + or - variation in the default nice value was "*leading the rest of the system to suffer in quite obvious ways*". I went back to default. - Having no longer paid any attention to this, I recently got the surprise to discover /usr/bin/X (1.20.8) launched *-nolisten tcp -keeptty :0 -auth blahblah* running with a nice value of -1. (*1) ---------- **Q1 :** Is this (running the X server with a nice value of -1) nowadays considered the best option for a desktop mainly running SCHED_OTHER tasks under default nice value ?
Note *1 below would, in some very curious way indicate that, if not the best option, it is a deliberate will from freedesktop irrespective of any context (clients, hardware, kernel, cpu pinning…) **Q2 :** Considering that I am also running a window/compositing manager (kwin_x11) said achieving most of the job the X-server used to achieve, should I consider consequent to also renice it ? in a greater or lesser amount that the X-server ? (X consumes on average 1,5 cpu time kwin_x11 does) (*2) **Q3 :** Would it be pertinent to base the nice relative values of X / kwin_x11 on the relative values of their unvoluntary context switches ? (kwin_x11 gets (during some of my typical desktop workload) about 30 times more unvoluntary context switches than X) ---------- **Q4 :** More generally speaking, in a client/server SCHED_OTHER world, is there a rule of thumb regarding relative nice values between servers and clients apps ? And, considering this particular case (of X server/ X client), can I assume that the client will, most of the time, be waiting for the server's availability ?
Can I also assume that the worst consequence of kwin_X11 not receiving enough cpu time is frame dropping and consequently that having some X client capable to output X fps on a regular basis and kwin_X11 dropping a couple of frames from time to time would be just absurd ? ---------- Figures when running some typical desktop workload for 5 minutes: X (nice -1) ucs : 1525 / kwin ucs (nice 0) 51834 (GT=53359)
X (nice -1) ucs : 6337 / kwin ucs (nice -2) 38415 (GT=44752) ---------- ***1 :** From what I understand in xinit code, xinit (parent) is responsible for that (`setpriority(PRIO_PROCESS, serverpid, -1); as part of the startserver procedure) right after forking the child that will later exec the server...
In fact… right after… the following comment : ***don't nice server*** ??? which indeed increases even more my perplexity. ***2 :** I know that Ananicy would heavily renice (-10) kwin if not even preferring some real time scheduling model (which I do not consider sensible (*3)). There is unfortunately no rationale given for this tuning and the corresponding rule is quite old (2018), a big amount of changes have been commited to kwin since. ***3 :** At least as far as kwin_X11 is concerned since, if my understanding is correct, the X server is still managing inputs.
Asked by MC68020 (8557 rep)
Jul 26, 2022, 11:28 AM
Last activity: Aug 2, 2022, 08:18 AM