Hi All,<br> Nobody has replied to my query here. So i am just wondering if there is a forum for block device driver where i can post my query.<br>Please tell me if there is any such forum.<br><br>Thanks,<br>Neha<br><br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">neha naik</b> <span dir="ltr"><<a href="mailto:nehanaik27@gmail.com">nehanaik27@gmail.com</a>></span><br>Date: Tue, Apr 9, 2013 at 10:18 AM<br>
Subject: Passthrough device driver performance is low on reads compared to writes<br>To: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br><br><br>Hi All,<br> I
have written a passthrough block device driver using 'make_request'
call. This block device driver simply passes any request that comes to
it down to lvm.<br>
<br>However, the read performance for my passthrough driver is around
65MB/s (measured through dd) and write performance is around 140MB/s for
dd block size 4096.<br>The write performance matches with lvm's write performance more or less but, the read performance on lvm is around 365MB/s.<br>
<br>I am posting snippets of code which i think are relevant here:<br><br>static int passthrough_make_request(<div>struct request_queue * queue, struct bio * bio)<br>{<br><br> passthrough_device_t * passdev = queue->queuedata;<br>
bio->bi_bdev = passdev->bdev_backing;<br> generic_make_request(bio);<br> return 0;<br>}<br><br>For initializing the queue i am using following:<br><br>blk_queue_make_request(passdev->queue, passthrough_make_request);<br>
passdev->queue->queuedata = sbd;<br>passdev->queue->unplug_fn = NULL;<br>bdev_backing = passdev->bdev_backing;<br>blk_queue_stack_limits(passdev->queue, bdev_get_queue(bdev_backing));<br>if ((bdev_get_queue(bdev_backing))->merge_bvec_fn) {<br>
blk_queue_merge_bvec(sbd->queue, sbd_merge_bvec_fn);<br>}<br><br>Now,
I browsed through dm code in kernel to see if there is some flag or
something which i am not using which is causing this huge performance
penalty.<br>
But, I have not found anything.<br><br>If you have any ideas about what i am possibly doing wrong then please tell me.<br><br>Thanks in advance.<br><br>Regards,<br>Neha</div>
</div><br>