RAW and soft RAID interaction

Davide Rossetti (davide.rossetti@roma1.infn.it)
Sat, 16 Oct 1999 13:55:50 +0200


hi Stephen,

By chance we found a (bad?) interaction between the raw device when
attached to md RAID0 devices. I easily tracked it down to
raw.c:raw_open() setting blocksize to 512. With this setting performange
goes from 30 MB/s down to 200KB/s on a 4 disk / 4 SCSI controller setup.
The easy fix:

sector_size = 512;
if (lookup_vfsmnt(bdev) != NULL) {
if (blksize_size[MAJOR(bdev)]) {
printk(KERN_INFO "raw(%d,%d): mounted blksize_size=%d\n",
MAJOR(bdev), MINOR(bdev),
blksize_size[MAJOR(bdev)][MINOR(bdev)]);
sector_size = blksize_size[MAJOR(bdev)][MINOR(bdev)];
}
} else {
if (hardsect_size[MAJOR(bdev)]) {
printk(KERN_INFO "raw(%d,%d): unmounted hardsect_size=%d\n",
MAJOR(bdev), MINOR(bdev),
hardsect_size[MAJOR(bdev)][MINOR(bdev)]);
sector_size = hardsect_size[MAJOR(bdev)][MINOR(bdev)];
> } else if (MAJOR(bdev) == MD_MAJOR) {
> printk(KERN_INFO "raw(%d,%d): setting sector_size = 1024\n",
> MAJOR(bdev), MINOR(bdev));
> sector_size = 1024;
}
}

while not being a production fix, at least allowed me to regain full
performance.
1024 seems to be the default MD blocksize.

Otherwise, it seems MD devices should define set their hardsect_size
array slot with 1024 or whatever.

PS: how much is the sector_size=512 default setting in RAW important ? I
mean, may someone safely change it to gain performance (seems to be
verified on our FibreChannel controller driver) ?
are 1024 or 2048 meaningful values ?

thanks for your great work and for RAW.

regards.

-- 
+------------------------------------------------------------------+
|Rossetti Davide   INFN - Sezione Roma I - gruppo V, prog. APEmille| 
|                  web    : http://apemaia.roma1.infn.it/~rossetti |
|    """""         E-mail : davide.rossetti@roma1.infn.it          |
|    |o o|         phone  : (+39)-06-49914412                      |
|--o00O-O00o--     fax    : (+39)-06-49914423   (+39)-06-4957697   |
|                  address: Dipartimento di Fisica (V.E.)          |
|                           Universita' di Roma "La Sapienza"      |
|                           P.le Aldo Moro,5 I - 00185 Roma - Italy|
|             pgp pub. key: finger rossetti@apemaia.roma1.infn.it  |
|                                                                  |
|"Most people think about twice a year.  I got famous by thinking  |
| once a week." - George B. Shaw                                   |
+------------------------------------------------------------------+

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