Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo performance on amd64 not satisfactory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Thu May 10, 2007 6:43 pm    Post subject: gentoo performance on amd64 not satisfactory Reply with quote

Hi !

I have noticed, especially when an emerge work is in progress, that the computer slows down a lot...my mouse cursor moves with a lot of lag or delay, theres delay in any video that i am watching or similar delays or stoppages in other applications that may be running. This also happens when i am downloading some file from a ftp server. Why is this problem happening?? It doesnt happen in ubuntu which is also installed (although that is i386). The relevant hardware config info if u need it:
Code:

AMD Athlon 64 2800+
512  DDR-RAM
Asus K8 Mobo.


My /etc/make.conf file :
Code:

# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"

USE="3dnowext X a52 aac aalib alsa amr avi cdparanoia cdr css dv dvd dvdr dvdread encode esd fbcon ffmpeg gif hal ieee1394 imlib iconv ipv6 java jpeg jpg lame live mad mikmod mmx mmxext mp3 mpi nvidia nsplugin ogg opengl perl png python qt3 qt4 quicktime real sdl sse sse2 theora threads tiff truetype unicode v4l vcd vcdimager video vidix vorbis x264 xine xv xvid yv12 -gtk -gnome"

Anything else?? Please help me to deal with this poor performance of the os
TIA
Back to top
View user's profile Send private message
xevix
Apprentice
Apprentice


Joined: 02 Oct 2004
Posts: 284
Location: Cali, USA

PostPosted: Thu May 10, 2007 6:54 pm    Post subject: Reply with quote

Try adding this to your make.conf

Code:

PORTAGE_NICENESS=5

_________________
AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ AuthenticAMD GNU/Linux 2x2.2 ghz
nVidia GeForce 8800 GTS 320Mb
250 gb SATA hd
2gb pc-3200 DDR
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Thu May 10, 2007 7:06 pm    Post subject: Re: gentoo performance on amd64 not satisfactory Reply with quote

r0ck80y wrote:
Hi !

I have noticed, especially when an emerge work is in progress, that the computer slows down a lot...my mouse cursor moves with a lot of lag or delay, theres delay in any video that i am watching or similar delays or stoppages in other applications that may be running.


Use the CFQ scheduler in your kernel and make sure dma is on on your hard drivers. That is a start. Also, watch your ram and swap while you are compiling. If ram gets filled you will have problems.

Quote:
It doesnt happen in ubuntu which is also installed


Sure, gentoo has no emerge command. Understand that emerge is a frontend to gcc -between a lot of many other tools-. Gcc can take a big amount of ram and cpu power while compiling stuff. So, watch your swap and your ram, and look into the thigs I said above. If they are fine, we can start looking elsewhere.

Do you think it is a 64 bits thing for any other reason or is it just an unfounded idea?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu May 10, 2007 7:18 pm    Post subject: Reply with quote

Optimize the kernel for a desktop.

Can also try a different CFS scheduler - here's an ebuild for it:

/usr/local/portage/sys-kernel/brebs-sources/brebs-sources-2.6.21.1.ebuild

Code:
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils

CFS_V=12
REV=1
KV="2.6.21"
K_REV=1

MY_PV="brebs${REV}"
KV_FULL="${KV}-${MY_PV}"
DIR="linux-${KV_FULL}"

DESCRIPTION="Low-latency scheduler kernel"
HOMEPAGE="http://kerneltrap.org/node/8059"
SRC_URI="mirror://gentoo/linux-${KV}.tar.bz2
   http://kernel.org/pub/linux/kernel/v2.6/patch-${KV}.${K_REV}.bz2
   http://people.redhat.com/mingo/cfs-scheduler/sched-cfs-v${KV}.${K_REV}-v${CFS_V}.patch
   http://people.redhat.com/mingo/cfs-scheduler/sched-cfs-auto-renice.patch"

KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"

PROVIDE="virtual/linux-sources"

S=${WORKDIR}/${DIR}

src_unpack() {
   unpack linux-${KV}.tar.bz2 patch-${KV}.${K_REV}.bz2

   local dir=$(find -maxdepth 1 -type d -name linux\*)
   mv "${dir}" "${DIR}" || die "mv"

   cd "${S}" || die

   epatch ../patch-${KV}.${K_REV} || die
   epatch "${DISTDIR}"/sched-cfs-auto-renice.patch || die
   epatch "${DISTDIR}"/sched-cfs-v${KV}.${K_REV}-v${CFS_V}.patch || die
}

src_compile() { :; }

src_install() {
   insinto /usr/src
   doins -r "${S}" || die
}

pkg_postinst() {
   cd "${ROOT}usr/src" || die
   ln -sfn "${DIR}" linux || die
}


Edit: Updated to kernel 2.6.21.1


Last edited by PaulBredbury on Mon May 14, 2007 9:48 am; edited 1 time in total
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Thu May 10, 2007 7:43 pm    Post subject: Reply with quote

Thanks Paul for the forum link!! My problem looks pretty much similar to that one.
My output of some of those commands:
Code:

# grep EMPT /usr/src/linux/.config

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_BKL=y

Code:
# grep HZ /usr/src/linux/.config
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250

Code:
# hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   1370 MB in  2.00 seconds = 684.91 MB/sec
 Timing buffered disk reads:   12 MB in  3.45 seconds =   3.47 MB/sec

Code:
# grep IDEDMA /usr/src/linux/.config
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y

Code:
# dmesg | grep -i dma
  DMA             0 ->     4096
  DMA32        4096 ->  1048576
  DMA zone: 56 pages used for memmap
  DMA zone: 1773 pages reserved
  DMA zone: 2170 pages, LIFO batch:0
  DMA32 zone: 1734 pages used for memmap
  DMA32 zone: 125146 pages, LIFO batch:31
ata1: SATA max UDMA/133 cmd 0xE800 ctl 0xE402 bmdma 0xD400 irq 20
ata2: SATA max UDMA/133 cmd 0xE000 ctl 0xD802 bmdma 0xD408 irq 20


Now how do i activate dma. If u mean enabling this in the kernel:
Code:

Device Drivers --->
  ATA/ATAPI/MFM/RLL support --->
    [*] Generic PCI bus-master DMA support
    [*]   Use PCI DMA by default when available

then that was done while i compiled the kernel for the first time. What should i do...not quite sure of the next step to take :?
Back to top
View user's profile Send private message
Galahad
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2003
Posts: 126

PostPosted: Thu May 10, 2007 7:53 pm    Post subject: Reply with quote

I suggest you read this: https://forums.gentoo.org/viewtopic-t-482731.html
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Thu May 10, 2007 9:42 pm    Post subject: Reply with quote

Galahad wrote:
I suggest you read this: https://forums.gentoo.org/viewtopic-t-482731.html


Thats a lot of reading there!! From what i read, it seems there are lots of things to try, mostly kernel tweaks. Just a couple of questions though (forgive my noobiness): I think i have a PATA drive (seagate baracudda) as it uses a signal and a power connector (or rather not the kind of cables used in a SATA drive). My lspci output is:
Code:

00:00.0 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.1 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.2 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.3 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.4 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.7 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]
00:0d.0 Non-VGA unclassified device: Unknown device 0107:8290 (rev 04)
00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)
00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
00:11.6 Communication controller: VIA Technologies, Inc. AC'97 Modem Controller (rev 80)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1)

Does it show that i have SATA drivers installed?? I dunno if it makes any difference!
Secondly, i can try the preemption and swappiness tweaks but how do i try/install a different cfs scheduler (with reference to PaulBredbury's post) ??

Thanks for the quick replies btw :)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu May 10, 2007 10:00 pm    Post subject: Reply with quote

With my ebuild above, use the CFQ scheduler as usual.
Code:
$ grep IOSCHED /usr/src/linux/.config
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"

The ebuild patches the kernel source code to use a rewritten ("completely fair") CFQ scheduler.
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Thu May 10, 2007 10:08 pm    Post subject: Reply with quote

PaulBredbury wrote:
With my ebuild above, use the CFQ scheduler as usual.
Code:
$ grep IOSCHED /usr/src/linux/.config
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"

The ebuild patches the kernel source code to use a rewritten ("completely fair") CFQ scheduler.


:oops: err..this is my first gentoo experience, so can you please explain in detail what i need to do with this ebuild??
Back to top
View user's profile Send private message
mudrii
l33t
l33t


Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Fri May 11, 2007 12:06 am    Post subject: Reply with quote

somthhins is strange with
Code:
# hdparm -tT /dev/hdb
/dev/hdb:
 Timing cached reads:   1370 MB in  2.00 seconds = 684.91 MB/sec
 Timing buffered disk reads:   12 MB in  3.45 seconds =   3.47 MB/sec


3.47Mb = ? very slow

check the dma on hdd if is set
_________________
www.gentoo.ro
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Fri May 11, 2007 6:30 am    Post subject: Reply with quote

:D
Things settled now...made some changes in the kernel. From what i remember i enabled the "enable dma for disks only" option under ATA/...settings and changed the I/O scheduler to "deadline". I think one or two more changes before recoompilation.
Code:

 # hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   1354 MB in  2.00 seconds = 676.90 MB/sec
 Timing buffered disk reads:  210 MB in  3.02 seconds =  69.49 MB/sec

Looks better now doesn't it??
I am running emerge and downloading files with no apparent choppiness or lags. Thanks for all the help guys..appreciate it :)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri May 11, 2007 6:54 am    Post subject: Reply with quote

r0ck80y wrote:
Timing cached reads: 1354 MB in 2.00 seconds = 676.90 MB/sec

That still seems slow. With a Core 2 Duo, DDR-800 RAM and a SATA drive, I get:
Code:
Timing cached reads:   9122 MB in  2.00 seconds = 4565.73 MB/sec

This is from sys-apps/hdparm-6.9-r1
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Fri May 11, 2007 9:57 am    Post subject: Reply with quote

Guess what!! Just checked this now and... 8O :?
Code:

# hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   1372 MB in  2.00 seconds = 686.08 MB/sec
 Timing buffered disk reads:   16 MB in  3.03 seconds =   5.28 MB/sec

What the hell is going on?! Also, there was a little, but not as severe as before lag when i was burning dvd on k3b. Things are not fixed yet.
@Paul..canu please elaborate on your ebuild and how to install it and what that'll do??
Thanks :)
Back to top
View user's profile Send private message
mudrii
l33t
l33t


Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Fri May 11, 2007 10:07 am    Post subject: Reply with quote

did you hdparm -it when you system was under load ?
_________________
www.gentoo.ro
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri May 11, 2007 10:27 am    Post subject: Reply with quote

Don't bother with my ebuild, it'll just confuse things. Configure the kernel that you're currently using properly for your hardware.
Back to top
View user's profile Send private message
r0ck80y
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 100

PostPosted: Fri May 11, 2007 11:47 am    Post subject: Reply with quote

mudrii wrote:
did you hdparm -it when you system was under load ?

yup..when k3b was running then that was the case...now its:
Code:

# hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   1348 MB in  2.00 seconds = 673.78 MB/sec
 Timing buffered disk reads:  216 MB in  3.01 seconds =  71.82 MB/sec

but it seems this is also less. Guess i need to find out what kernel config is best suited for the hardware. Cant think of what to change though !!
How do i change this setting:-
Code:
# grep HZ /usr/src/linux/.config
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250

and make it 1000 instead of 250, if its going to help in any way!!
Back to top
View user's profile Send private message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Mon May 21, 2007 11:20 am    Post subject: Reply with quote

Hello,

I am using like PaulBredbury a Core 2 Duo 6400 system with SATA drive and get the following:

hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 2084 MB in 2.00 seconds = 1042.41 MB/sec
Timing buffered disk reads: 116 MB in 3.56 seconds = 32.59 MB/sec

This is without any process running.

This seems slow, so what could be wrong? Wrong HD parameters? I tried hdparm -i /dev/sda but it did not work (presumably hdparm does not work very well with SATA drives).

Can someone give some pointers, I also feel that the performance on this Core 2 Duo system / amd64 is MUCH less than it should be.

uname -a gives:

Linux Valinor 2.6.20.6 #1 SMP Mon Apr 30 10:59:37 CEST 2007 x86_64 Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz GenuineIntel GNU/Linux

Are there any benchmarks to test the speed of your system overall?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9695
Location: almost Mile High in the USA

PostPosted: Wed May 30, 2007 9:57 pm    Post subject: Reply with quote

32MB/sec seq reads isn't way too bad for a laptop disk...
and once again hdparm is a crappy synthetic benchmark that can be compiled weird in so many different ways that you should take it with a grain of salt.

My Pentium-M 1600 (Dothan) with a 2.5" HDD (Laptop, 5400RPM), hdparm-6.9

/dev/hda:
Timing cached reads: 1026 MB in 2.00 seconds = 512.82 MB/sec
Timing buffered disk reads: 92 MB in 3.03 seconds = 30.32 MB/sec

The machine is as fast as I expect it to be, so this should be "normal". But if you're getting single digit MB/sec with today's modern disks, something is definately wrong with your disk subsystem (likely due to not running native drivers and thus going back to PIO mode).
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Thu May 31, 2007 8:34 pm    Post subject: Reply with quote

I am NOT on a laptop disk !!

I am on a desktop using a good recent motherboard and a normal 7200 RPM SATA HD, so...

What about these native drivers/ PIO mode, can you tell me more?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum