2.6.18-mm3 pktcdvd: bio write congestion control
Subsystems (3)
PATCH 8/11 2.6.18-mm3 pktcdvd: bio write congestion control
Hello,
this patch adds the ability to control the size of the drivers bio write queue.
See the Documentation/* files in the patch for further infos.
http://people.freenet.de/BalaGi/download/pktcdvd-8-wqueue-congestion_2.6.18.patch
-Thomas Maier
Documentation/ABI/testing/sysfs-class-pktcdvd +17 -0
@@ -38,6 +38,23 @@ these files in the sysfs: reset (0200) Write any value to it to reset pktcdvd device statistic values, like bytes read/written. + +/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/ + size (0444) Contains the size of the bio write + queue. + + congestion_off (0644) If bio write queue size is below + this mark, accept new bio requests + from the block layer. + + congestion_on (0644) If bio write queue size is higher + as this mark, do no longer accept + bio write requests from the block + layer and wait till the pktcdvd + device has processed enough bio's + so that bio write queue size is + below congestion off mark. + Example:
Documentation/cdrom/packet-writing.txt +20 -2
@@ -125,8 +125,26 @@ To read pktcdvd device infos in human re For a description of the debugfs interface look into the file: Documentation/ABI/testing/debugfs-pktcdvd - - + + +Bio write queue congestion marks +-------------------------------- +The pktcdvd driver allows to adjust the behaviour of the +internal bio write queue. +This can be done with the two write_congestion_[on|off] marks. +The driver does only accept up to write_congestion_on bio +write request from the i/o block layer, and waits till the +requests are processed by the mapped block device and +the queue size is below the write_congestion_off mark. +In previous versions of pktcdvd, the driver accepted all +incoming bio write request. This led sometimes to kernel +out of memory oops (maybe some bugs in the linux kernel ;) +CAUTION: use this options only if you know what you do! +The default settings for the congestion marks should be ok. +The maximum size of the bio write queue can influence +driver's cpu load and memory consumption. + + Links -----
drivers/block/pktcdvd.c +125 -1
230 lines not on this page · raw message
include/linux/pktcdvd.h +13 -1
@@ -123,6 +123,14 @@ struct pkt_ctrl_command {#endif +/* default bio write queue congestion marks */ +#define PKT_WRITE_CONGESTION_ON 5000 +#define PKT_WRITE_CONGESTION_OFF 4500 +#define PKT_WRITE_CONGESTION_MAX (1024*1024) +#define PKT_WRITE_CONGESTION_MIN 100 +#define PKT_WRITE_CONGESTION_THRESHOLD 25 + +struct packet_settings {__u32 size;/* packet size in (512 byte) sectors */
@@ -291,7 +299,11 @@ struct pktcdvd_devicestruct packet_iosched iosched;struct gendisk *disk; - + +wait_queue_head_t write_congestion_wqueue; +int write_congestion_off; +int write_congestion_on; +struct class_device *clsdev;/* sysfs pktcdvd[0-7] class dev */ struct pktcdvd_kobj *kobj_stat;/* sysfs pktcdvd[0-7]/stat/ */ struct pktcdvd_kobj *kobj_wqueue;/* sysfs pktcdvd[0-7]/write_queue/ */
Quoted 4 lines · Thomas Maier
Hello,
this patch adds the ability to control the size of the drivers bio write queue.
imho, this should not be a configuration option. The driver is perfectly capable of sizing this queue appropriately (determined by the device) without user interaction. Basically the option just needs to prevent the system from falling over, just choose some low sane value.
Signature · 1 line
Jens Axboe
Hello,
the idea was to give the user/admin the ability to control cpu load and memory consumption while the driver write to DVD / CD, at least for testing purposes.
Maybe move this interface into debugfs?
-Thomas
Am 03.10.2006, 17:29 Uhr, schrieb Jens Axboe <[email protected]>:
Quoted 11 lines · Thomas Maier
Quoted 4 lines
Hello,
this patch adds the ability to control the size of the drivers bio write queue.
imho, this should not be a configuration option. The driver is perfectly capable of sizing this queue appropriately (determined by the device) without user interaction. Basically the option just needs to prevent the system from falling over, just choose some low sane value.