Re: tuning for large files in xfs

From: fitzboy
Date: Tue May 23 2006 - 16:20:35 EST

Avi Kivity wrote:

This will overflow. I think that

currentPos = drand48() * s.st_size;

will give better results


why would it overflow? Random() returns a 32 bit number, and if I multiple that by 32k (basically the number random() returns is the block number I am going to), that should never be over 64 bits? It may be over to size of the file though, but that is why I do mod s.st_size... and a random number mod something is still a random number. Also, with this method it is already currentSize aligned...

Sorry, I wasn't specific enough: please run iostat -x /dev/whatever 1 and look at the 'r/s' (reads per second) field. If that agrees with what your test says, you have a block layer or lower problem, otherwise it's a filesystem problem.

I ran it and found an r/s at 165, which basically corresponds to my 6 ms access time... when it should be around 3.5ms... so it seems like the seeks themselves are taking along time, NOT that I am doing extra seeks...
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at