[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X niceness



You wrote (in your message from Thu 10)
 > I'm running an X server I got from ftp.xfree86.org on my 2.4 i386.  The
 > mouse action is pitiful, very sticky if I'm compiling at the same time.  Is
 > this a bug or a feature?  I noticed that my X server runs at about PRI 85
 > and NI 20.  On 2.3 it used to run at PRI 2 and NI 0.

NI 20 looks strange to me and would certainly explain the
stickyness. I though that the autonice feature where the kernel would
automatically raise the nice value of a process that has reached a
certain amount of CPU time had been removed.

BTW what kind of mouse is it ? serial or PS/2 ?

My quick hack to have better response from the X server under havy
system load is to start it at nice -10 (either from xdm by using
/usr/bin/nice in /var/X11/xdm/Xservers or with the following dirty
patch to Xwrapper:)

*** X11/xc/programs/Xserver/os/wrapper.c	Fri Nov 27 22:35:25 1998
--- X11/xc/programs/Xserver/os/wrapper.c.mh	Sun Aug 16 10:23:18 1998
***************
*** 47,52 ****
--- 47,54 ----
  #include <string.h>
  #include <errno.h>
  #include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
  
  /* Neither of these should be required for XFree86 3.3.2 */
  #ifndef REJECT_CONFIG
***************
*** 206,211 ****
--- 208,221 ----
  #endif
      switch (bad) {
      case NotBad:
+ #ifdef PRIO_PROCESS
+         errno = 0;
+         setpriority(PRIO_PROCESS, getpid(), -10);
+ 	if (errno) 
+ 	    perror("setpriority");
+ 	printf("New priority: %d\n", getpriority(PRIO_PROCESS, getpid()));
+ #endif
+ 
  	execve(XSERVER_PATH, argv, envp);
  	fprintf(stderr, "execve failed for %s (errno %d)\n", XSERVER_PATH,
  		errno);



-- 
					Matthieu