Hello Alan, Hi list-readers!
I'd like to suggest a change to ll_rw_blk and blkdev.h in the 2.2-Kerne=
l:
rational
-----
On mainframe architectures, we're running a large number of disks on a
System. Our disk-device-driver (dasd) has a static major number for the=
first 64 disks and uses dynamicaly allocated ones for the rest.
In ll_rw_blk there are static allocated lists (CASE_COALESCE*) for majo=
rs
that support merging requests (including our static one DASD_MAJOR).
For the dynamic allocated majors, our requests do not get clustered whi=
ch
leads to a major performance drop.
the patch
-------
I added a global int field named blk_merge_rule to blkdev.h, which cont=
ains
the device driver's rule about merging. I did three definitions for th=
is
variable: do not merge (the default), do merge, and merge but not the f=
irst
request (like for the static majors).
The device driver has to set this field for a major it uses and reset i=
t
to BLK_MERGE_NEVER when freeing the major.
In ll_rw_blk I invented a case, which is taken if there is no static
setting
for the major. It then processes like set in blk_merge_rule.
If the device driver has a static setting for its major, it does'nt hav=
e to
care
about blk_merge_rule. If the device driverhas no static setting and doe=
s
not
set blk_merge_rule, the requests do not get merged (same as before).
I attached the patch (sorry, notes messes up white-spaces when embeddin=
g
stuff), it applies against 2.2.19. (See attached file: dyn_majors.diff)=
What is your opinion about including it into the standard brach?
Why not change all block-dev-drivers so that they set blk_merge_rule an=
d
throw out the CASE_COALESCE* stuff and simplify the code again?
mit freundlichem Gru=DF / with kind regards
Carsten Otte
IBM Deutschland Entwicklung GmbH
Linux for 390/zSeries Development - Device Driver Team
Phone: +49/07031/16-4076
IBM internal phone: *120-4076
-- We are Linux. Resistance indicates that you're missing the point! =--0__=La1HrIzDHV4YTiUU6KgjBGjFGH5Wm5WPN0OU7lcClyYJOMSbwS3O3T5W Content-type: application/octet-stream; name="dyn_majors.diff" Content-Disposition: attachment; filename="dyn_majors.diff" Content-transfer-encoding: base64
SW5kZXg6IGRyaXZlcnMvYmxvY2svbGxfcndfYmxrLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2hv bWUvY3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sdWRlL2xpbnV4L2Jsa2Rldi5oCj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KUkNTIGZpbGU6IC9ob21lL2N2cy9saW51eC9pbmNsdWRlL2xpbnV4L2Jsa2Rldi5o LHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjQKcmV0cmlldmluZyByZXZpc2lvbiAxLjUKZGlmZiAt dSAtdyAtcjEuNCAtcjEuNQotLS0gaW5jbHVkZS9saW51eC9ibGtkZXYuaAkyMDAxLzAxLzE4IDEz OjA1OjEyCTEuNAorKysgaW5jbHVkZS9saW51eC9ibGtkZXYuaAkyMDAxLzA1LzMxIDE0OjEwOjUz CTEuNQpAQCAtMTA3LDYgKzEwNywxNSBAQAogCiBleHRlcm4gaW50ICogbWF4X3NlZ21lbnRzW01B WF9CTEtERVZdOwogCitleHRlcm4gaW50IGJsa19tZXJnZV9ydWxlW01BWF9CTEtERVZdOworCisv KgorICogZGVmaW5pdGlvbnMgd2hpY2ggY2FuIGJlIHNldCBpbnRvIGJsa19tZXJnZV9ydWxlIAor ICovCisjZGVmaW5lIEJMS19NRVJHRV9ORVZFUiAwIAorI2RlZmluZSBCTEtfTUVSR0VfQlVUX0ZJ UlNUX1JFUVVFU1RfTUFZX0JFX0JVU1kgMQorI2RlZmluZSBCTEtfTUVSR0VfQUxTT19GSVJTVF9S RVFVRVNUIDIKKwogI2RlZmluZSBNQVhfU0VDVE9SUyAxMjgKIAogI2RlZmluZSBNQVhfU0VHTUVO VFMgTUFYX1NFQ1RPUlMK
--0__=La1HrIzDHV4YTiUU6KgjBGjFGH5Wm5WPN0OU7lcClyYJOMSbwS3O3T5W--
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/