Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29900 - X/xdm nicing to -1 if started as root (bad for O(1) kernels)
Summary: X/xdm nicing to -1 if started as root (bad for O(1) kernels)
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Low normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-29 06:47 UTC by kfm
Modified: 2006-03-31 19:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (8600_all_4.3.99-fix-nicing-to-minus-one.patch,320 bytes, patch)
2003-12-04 16:54 UTC, Andrew Bevitt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kfm 2003-09-29 06:47:30 UTC
Hi there. I have become aware that when X is started under an account which has sufficient priveleges to set the nice priority level for a process (i.e. root), the X server is niced to -1. Obviously, with xdm/kdm/gdm this is "unavoidable" in a default setup. I consider this to be a bug because the vast majority of kernels that Gentoo users choose (including the default gentoo-sources) feature the O(1) scheduler, and renicing X is generally /bad/ for overall "desktop" performance with this scheduler!

Thus, if I startx as root or use xdm, I must manually renice X to 0. As far as I know there are only two situations where renicing X can be beneficial:

1) Kernels that don't feature the O(1) scheduler, such as 2.4 mainline
2) Possibly 2.6.0-test5 with Nick Piggin's scheduler policy patch v15 (not that many are probably using that ;-)

Renicing X with the O(1) scheduler runs the risk of giving too many processor cycles to X, affecting the quality of the scheduling decisions, and stealing time away from other processes where it isn't merited - particularly the likes of xmms, and other multimedia stuff.

I don't know how the renice process occurs, but IMHO it shouldn't occur. Or perhaps it should default to 0, and a configuration directive should be introduced which allows for easy reconfiguration of the nice level for those who choose not to use O(1) based kernels. Any thoughts?
Comment 1 kfm 2003-09-29 06:48:04 UTC
eep, sorry about the bad wrapping there ... :-/
Comment 2 kfm 2003-09-29 07:45:38 UTC
Hmm. The plot thickens. I've consulted with two other users so far, and the
problem does not occur for them when using xdm. However, it does occur for
them when using startx as root. For me, it occurs in both scenarios. The
sources being used vary. In my case it happens under every kernel I've tried
thus far (quite a few), the others were using 2.4.22 (vanilla I think) and
gentoo-sources. I'm quite confused now :/
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2003-09-29 09:47:04 UTC
I ran "grep -r nice /usr/X11R6/ /etc/X11/ | grep -v Binary" and didn't find
any use of the nice command, just comments with the word nice. So it doesn't
look like it's coming from any xfree config files at first glance.
Comment 4 Andrew Bevitt 2003-12-04 16:54:53 UTC
Created attachment 21718 [details, diff]
patch

This is the patch for xinit which will stop the server being 
niced to -1, no-one quite knows why this is done at all really
so this probably needs to be tested out etc...

Everyone on the xfree ML knows what happens, but no-one really
mentioned why it is done.
Comment 5 kfm 2004-08-17 09:13:41 UTC
Bump! Just a note to say that maybe this bug should be closed (I don't know whether it's relevant or not anymore, but as xorg appears to be the X server of choice these days then perhaps it is not a big issue).
Comment 6 Lance Albertson (RETIRED) gentoo-dev 2004-09-30 08:32:19 UTC
Marking invalid because xorg-x11 is the only xserver supported by Gentoo right now. 
Comment 7 Donnie Berkholz (RETIRED) gentoo-dev 2004-09-30 09:29:20 UTC
Let's see whether this is still relevant for xorg-x11 (which I'm almost sure it is) before closing, hmm?
Comment 8 Simon Strandman 2005-10-01 01:17:25 UTC
This bug still exists in xorg-x11 6.8.3-r4.
Comment 9 Simon Strandman 2005-10-01 01:18:00 UTC
Sorry I meant 6.8.2-r4.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2006-03-31 19:33:32 UTC
Simon, or anyone else, if you'd like to pursue this, please file an upstream bug at bugs.freedesktop.org in the xorg product with Andrew's patch, and post the URL here.

Thanks!