You are not logged in.

#1 2003-10-03 01:08:50

hollywoodb
Member
From: USA
Registered: 2003-10-03
Posts: 39

slow X performance.....

I've noticed that my xfree performance is much slower than other distros I've tried, I'm wondering if there are any configuration options I'm not aware of.... my xf86config, kernel, rc.*'s etc are setup right-right.... performance is slower in wdn (plain X) and in KDE. I want to install KFCE4, but not until I've rectified my system performance.  Also, when I try to run hdparm -d 1 -k 1 /dev/hda, it says unable to set dma mode.  This is a problem since my HD transfer rate is 3.97M/sec, when it should (and usually is) 40.  what would cause this. *note, I can't get hdparm to recognize the /dev/discs/etc etc format.

Offline

#2 2003-10-03 08:03:51

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: slow X performance.....

The linux kernel is actually not that great out of the box with interactive/multimedia applications. What some distributions do in order to counter this is increase the priority of XFree86. If you would like to try this, change your XDM / KDM / GDM config file (I forget which one I think it's "Xservers") and change the part that reads:

/usr/X11R6/bin/X

to

/usr/bin/nice -10 /usr/X11R6/bin/X

this will start it with 'realtime' priority.


Possibly a better solution:

make your own PKGBUILD that uses the Alan Cox patchset to the kernel (kernel-ac) ..I find it is much more responsive. Make sure you enable pre-emptive scheduling (and possibly low-latency) in the kernel config.

Hapy.

Offline

#3 2003-10-03 08:07:44

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: slow X performance.....

Of course the other major issue that will help is fixing your hdparm issue as well... I'm not sure what is wrong with your setup, I run hdparm at bootup with the command

/sbin/hdparm -c3 -u1 /dev/hdb

which are the optimal settings for my machine I think.

If your computer is spending all it's time with slow HD accesses this will reduce all performance. Normally Arch is faster than almost all other linux distributions if you are not having any strange issues.

Hapy.

Offline

#4 2003-10-03 09:35:56

hollywoodb
Member
From: USA
Registered: 2003-10-03
Posts: 39

Re: slow X performance.....

here's what I get running hdparm:

# hdparm -d1 -k1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
setting keep_settings to 1 (on)
using_dma    =  0 (off)
keepsettings =  1 (on)
#

Offline

#5 2003-10-03 20:21:05

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: slow X performance.....

hollywoodb wrote:

here's what I get running hdparm:

# hdparm -d1 -k1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
setting keep_settings to 1 (on)
using_dma    =  0 (off)
keepsettings =  1 (on)
#

OK, dumb question:  Are you running 'hdparm' as root?


-- Linux!  Isn't it time?

Offline

#6 2003-10-03 20:45:43

zen_guerrilla
Member
From: Greece
Registered: 2002-12-22
Posts: 259

Re: slow X performance.....

AFAIK Kernels >=2.4.20 have DMA enabled by default for IDE hdd's & cdrom's. To check if DMA is enabled on your system do (as root):

cat /proc/ide/hda/settings | grep dma

If the first digit is 1 you should be fine, if it's 0 & you can't enable it by hdparm -d1 then you either have misconfigured your ide controller in kernel configuration or your hardware has problems.

Offline

#7 2003-10-05 22:37:51

hollywoodb
Member
From: USA
Registered: 2003-10-03
Posts: 39

Re: slow X performance.....

yep, I'm running as root.... arch is the first distro I've ever had this problem with, anyways, here's what I get:

[root@myhost /]# hdparm -d1 -k1 /dev/hda

/dev/hda:
  setting using_dma to 1 (on)
  HDIO_SET_DMA failed: Operation not permitted
  setting keep_settings to 1 (on)
  using_dma        = 0 (off)
  keepsettings     = 1 (on)
[root@myhost /]# cat /proc/ide/hda/settings | grep dma
using_dma         0          0           1          rw
[root@myhost /]# hdparm -t /dev/hda

/dev/hda:
  Timing buffered disk reads:      10 MB in    3.28 seconds =    3.05  MB/sec
[root@myhost /]#

normally the last result is between 35 and 40 on my system.  I've tried a kernel recompile, reinstalled hdparm, checked bios... I can boot my slackware partition and run hdparm without a problem at all.  if I run hdparm on /dev/discs/disc0/disc I get the exact same results.

Offline

#8 2003-10-05 23:00:46

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: slow X performance.....

are you using the regular kernel or the scsi kernel?

have you tried using something other than just -d1? when i had to fix my cdrom drive with hdparm i had too use something like -X33 or along those lines.

some systems just require more tweaks than others (for example i did not have to use hdparm when i ran Libranet)

you have to be sure that you only have the first dma option in the kernel enabled and not the second one. the second with for surely kill your manual control of dma (iirc)


AKA uknowme

I am not your friend

Offline

#9 2003-10-05 23:37:52

jlvsimoes
Member
From: portugal
Registered: 2002-12-23
Posts: 392
Website

Re: slow X performance.....

arch for me is the fastest thing that i have seen  about the hdparm
i use this line in rc.local
hdparm -q -M 254 -W1 -D1 -c3 -m16 -X69 -d1 -u -a /dev/myidedrive/here
a man hdparm will tell wath this does and i realy do think that this is tweaked
X ide performance dvd playing all ok


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU/ d- s: a- C L U P+ L+++ E--- W+
N 0+ K- W-- !O !M V-- PS+ PE- V++ PGP T 5 Z+ R* TV+ B+
DI-- D- G-- e-- h! r++ z+ z*
------END GEEK CODE BLOCK------

Offline

#10 2003-10-06 01:13:17

hollywoodb
Member
From: USA
Registered: 2003-10-03
Posts: 39

Re: slow X performance.....

I'm using my own kernel complile, 2.4.22, nothing special about it, no extra patches, etc... does this sound like a permissions problem?  I just tried running the quake3 arena demo installer, and it came back permission denied.  I'm logged in as root, this I know for certain, but this seems odd behaviour.  hdparm -d1 -k1 /dev/hda works like a charm under my other partitions

Offline

#11 2003-10-06 13:00:13

Bobonov
Member
From: Roma - Italy
Registered: 2003-05-07
Posts: 295

Re: slow X performance.....

Wow how far people went...
Maybe is only a problem with Xserver configuration file.....
Are you sure you correctly setted your graphic card?
Did you load DRI GFX, OpenGL module?

Offline

#12 2003-10-07 06:00:37

hollywoodb
Member
From: USA
Registered: 2003-10-03
Posts: 39

Re: slow X performance.....

solved it, was a kernel compile problem... 2 things i missed: /dev/agpgart and nvidia chipset support, and another generic support option (can't remember if it was generic pci or ide).  anyways, now my sys cruises like it should, avg hdparm -t /dev/discs/disc0/disc = 41.45 MB/sec

Offline

#13 2003-10-16 22:40:53

Luis Q. R.
Member
Registered: 2003-02-20
Posts: 106

Re: slow X performance.....

Where's the configuration file for kdm, please?

Offline

#14 2003-10-17 05:42:02

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: slow X performance.....

off the top of my head it's something like

/opt/kde/share/config/kdm

no guarantees, but it should get you looking in relatively the right place.

Hapy.

Offline

#15 2003-10-17 16:44:40

Luis Q. R.
Member
Registered: 2003-02-20
Posts: 106

Re: slow X performance.....

I've edited /opt/kde/share/config/kdm/Xservers to look like this:

:0 local@tty1 /usr/bin/nice -10 /usr/X11R6/bin/X vt7

and it doesn't work any better. By the way:

[root@pc kdm]# hdparm -t /dev/hda

/dev/hda:
Timing buffered disk reads:  120 MB in  3.00 seconds =  40.00 MB/sec
[root@pc kdm]# hdparm -t /dev/hda

That should be ok, but it's not enough.

Now I've patched the kernel with Alan Cox patchset and I don't find the pre-emptive scheduling and low-latency options. Where are them?

Offline

#16 2003-10-17 17:13:36

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: slow X performance.....

alright, look for the options:

CONFIG_LOLAT
CONFIG_PREEMPT

set them both "=y" ... they are likely commented out if you are looking in the config file.

also I believe if you are using the X kernel config program its under "Processor Type and Features"

make sure you remember to edit the config file or save it back to the config file in /var/abs/kernels/kernel/ so that when you use makepkg it actually uses that config and does not copy over the one you just made (if you are using the xconfig)

By "doesn't work any better" what are your goals, like is something not working well enough at this point? Just wondering as the context may make a difference.

I would suggest trying it both with and without the "nice -10" once you have the low-latency and pre-emption enabled, I found it reduced preformance to have it enabled once I had the patches runnning.

as far as hdparm settings, here's mine:

/sbin/hdparm -c3 -u1 /dev/hdb

-c is for setting 32/16bit IO support make sure you have 32bit set if your system supports it

-u1 permits other interrupts to be serviced while processing disk interrupts. This setting can be dangerous with some h/w combinations, research the proper means of testing this ... there are documents available online for how to test/optimize your hdparm settings. But this setting helped me alot when I was having problems with skipping video while multitasking.

let me know how it goes. smile

Hapy.

Offline

#17 2003-10-18 15:16:40

Luis Q. R.
Member
Registered: 2003-02-20
Posts: 106

Re: slow X performance.....

By "doesn't work any better" I mean that KDE loads in 1:20 minutes and Mozilla in 30 seconds, while in other distros I've tried like Slackware 9.1 and Mandrake 9.1 they load in 10 and 2 seconds respectively, with my own compiled kernel and no patches.

The preemptive scheduling and low latency options are not in the Processor type and features section, by the way.

Offline

#18 2003-10-18 17:56:31

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: slow X performance.....

Alright, that probably means you are editing the config file BEFORE it's patched. I don't know how much experience you have with making a new kernel package on arch so I'll just go through the basics and you can search for other help if it doesn't work, or ask

here's a packagebuild file for the AC kernel-patchset.

# $Id: PKGBUILD,v 1.25 2003/08/25 19:37:06 judd Exp $
# Maintainer: Judd Vinet <jvinet@zeroflux.org>
# Committer: Judd Vinet <jvinet@zeroflux.org>
pkgname=kernel
pkgver=2.4.22
pkgrel=1
pkgdesc="The Linux Kernel and modules (IDE support)"
url="http://www.kernel.org"
backup=('boot/kconfig')
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$pkgver.tar.bz2 
  http://kernel.org/pub/linux/kernel/people/alan/linux-2.4/2.4.22/patch-$pkgver-ac4.gz
  config)

build() {
  rm -rf $startdir/pkg/*
  cd $startdir/src
  cp patch-2.4.22-ac4 linux-2.4.22/
  cd linux-2.4.22
  patch -p1 < patch-2.4.22-ac4
  cd $startdir/src/linux-$pkgver
  cp ../config ./.config
  yes "" | make config
  make dep clean bzImage modules || return 1
  mkdir -p $startdir/pkg/{lib/modules,boot}
  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
  cp System.map $startdir/pkg/boot
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz
  mkdir -p $startdir/pkg/usr/src/linux/include
  cp -a include/linux $startdir/pkg/usr/src/linux/include/
  cp -a include/asm-i386 $startdir/pkg/usr/src/linux/include/
  cd $startdir/pkg/usr/src/linux/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux
  cd $startdir/pkg/lib/modules/$pkgver && 
    (rm -f build; ln -sf /usr/src/linux build)
  # cd $startdir && ./mkinitrd -k "$pkgver" -o image
  install -D -m644 $startdir/src/config $startdir/pkg/usr/src/linux/.config
  install -D -m644 $startdir/src/config $startdir/pkg/boot/kconfig
}

copy this to a file into a dir like "/var/abs/local/kernel-ac" then copy all the other files (but not the pkgbuild) from "/var/abs/kernels/kernel"

then type "makepkg"

once it has unpacked the kernel archive, patched it and started compiling, press CTRL-C to stop it.

go into "/var/abs/local/kernel-ac/src/linux-2.4.22" and find the newly patched "config" or ".config" forget what it is.

copy it back to "/var/abs/local/kernel-ac/config" and then edit it. it should have the above options now. set them to "y" and run makepkg again and it should build correctly.

Taking 1:20 to load KDE (you mean from the point where you enter your login/pw? or from turning the machine on?) is not normal for arch.  Same with 30s to start mozilla. The lowlatency & pre-emptive patches aren't really what you want to be looking at to speed this up (though they might help a tiny bit). They are more oriented towards multi-tasking.

Hapy.

Offline

#19 2003-10-20 20:28:28

Luis Q. R.
Member
Registered: 2003-02-20
Posts: 106

Re: slow X performance.....

I was checking some things and then I realized that there wasn't a a symbolic link /etc/X11/X pointing to /usr/X11R6/bin/XFree86. I thought it was necessary.

So I made that link and now everything loads much faster (KDE 20 secs, Mozilla 10 secs). Why wasn't there that link?

Well, I'm going to try the 2.6 kernel, I've been reading many good things about it, let's see if it's true.

Offline

Board footer

Powered by FluxBB