Re: [git patches] IDE update

From: Jens Axboe
Date: Tue Jul 05 2005 - 09:40:27 EST


On Tue, Jul 05 2005, Ondrej Zary wrote:
> Jens Axboe wrote:
> >On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote:
> >
> >>>Ok, looks alright for both. Your machine is quite slow, perhaps that is
> >>>showing the slower performance. Can you try and make HZ 100 in 2.6 and
> >>>test again? 2.6.13-recent has it as a config option, otherwise edit
> >>>include/asm/param.h appropriately.
> >>>
> >>
> >>I forgot to write that my 2.6.12 kernel is already compiled with HZ 100
> >>(it makes the system more responsive).
> >>I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD
> >>performance comparing to 2.6.12.
> >
> >
> >OK, interesting. You could try and boot with profile=2 and do
> >
> ># readprofile -r
> ># dd if=/dev/hda of=/dev/null bs=128k
> ># readprofile > prof_output
> >
> >for each kernel and post it here, so we can see if anything sticks out.
> >
> Here are the profiles (used dd with count=4096) from 2.4.26 and 2.6.12
> (nothing from 2.6.8.1 because I don't have the .map file anymore).

Looks interesting, 2.6 spends oodles of times copying to user space.
Lets check if raw reads perform ok, please try and time this app in 2.4
and 2.6 as well.

# gcc -Wall -O2 -o oread oread.c
# time ./oread /dev/hda

--
Jens Axboe

#include <stdio.h>
#include <unistd.h>
#define __USE_GNU
#include <fcntl.h>
#include <stdlib.h>

#define BS (131072)
#define BLOCKS (4096)
#define ALIGN(buf) (char *) (((unsigned long) (buf) + 4095) & ~(4095))

int main(int argc, char *argv[])
{
char *buffer;
int fd, i;

if (argc < 2) {
printf("%s: <device>\n", argv[0]);
return 1;
}

fd = open(argv[1], O_RDONLY | O_DIRECT);
if (fd == -1) {
perror("open");
return 2;
}

buffer = ALIGN(malloc(BS + 4095));

for (i = 0; i < BLOCKS; i++) {
int ret = read(fd, buffer, BS);

if (!ret)
break;
else if (ret < 0) {
perror("read infile");
break;
}
}

return 0;
}