Re: [NBD] patch and documentation

From: Sven Köhler
Date: Mon Sep 08 2003 - 15:23:15 EST


The patch also looks harmless enough for applying ;-).

Harmless enough, although I'm not sure it really makes that much
difference. The max_sectors being set to 255 doesn't, by itself, explain
the back and forth 127k, 1k request thing. Typically what you'll see is
127k, 127k, 127k, etc. and then some odd sized request at the end. Or
the device gets unplugged anyway at some point and there are odd sized
requests scattered throughout...that's especially going to be true if
the reads or writes are from an actual disk, rather than /dev/null. I
may be just coincidence that setting max_sectors to 256 actually helps.
Also, are we sure that all those requests you're seeing are of the same
type (all reads, all writes)?

Well, i guess the cache uses a value of 256 sectors to do read-ahead and such. I used dd if=/dev/nbd/0 of=/dev/null bs=X with both X=1 and X=1M.
Both with the same result. That the 1byte requests join together to bigger ones can only be explained with read-aheads strategies.
Anyway, the result is always the same:

without patch: 127KB, 1KB, 127KB, 1KB
with path: 128KB, 128KB, 128KB

As long as dd doesn't write i'm sure that i didn't see any write requests. In addition it is a very regular pattern.
If it is really the case that the cache reads 256 sectors and the default limit is 255, than this would also happen for all other block-devices. In addition it would be a good thing to look up if the cache takes the max_sectors stuff into accout while determining the amout of sectors it reads ahead.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/