Yes. Interestingly my direct write i/o performance is better than my direct read i/o performance for my passthrough device... And that doesn't make any kind of sense to me.<br><br>pdev0 = pass through device on top of lvm<br>
<br>root@voffice-base:/home/neha/sbd# time dd if=/dev/pdev0 of=/dev/null bs=4096 count=1024 iflag=direct<br>1024+0 records in<br>1024+0 records out<br>4194304 bytes (4.2 MB) copied, 4.09488 s, 1.0 MB/s<br><br>real 0m4.100s<br>
user 0m0.028s<br>sys 0m0.000s<br><br>root@voffice-base:/home/neha/sbd# time dd if=/dev/shm/image of=/dev/pdev0 bs=4096 count=1024 oflag=direct<br>1024+0 records in<br>1024+0 records out<br>4194304 bytes (4.2 MB) copied, 0.0852398 s, 49.2 MB/s<br>
<br>real 0m0.090s<br>user 0m0.004s<br>sys 0m0.012s<br><br>Thanks,<br>Neha<br><br><div class="gmail_quote">On Thu, Apr 11, 2013 at 11:53 AM, Rajat Sharma <span dir="ltr"><<a href="mailto:fs.rajat@gmail.com" target="_blank">fs.rajat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">so you mean direct I/O read of your passthrough device is lower than<br>
direct I/O read of lvm?<br>
<div><div><br>
On Thu, Apr 11, 2013 at 8:39 PM, neha naik <<a href="mailto:nehanaik27@gmail.com" target="_blank">nehanaik27@gmail.com</a>> wrote:<br>
> Hi,<br>
> I am calling the merge function of the block device driver below me(since<br>
> mine is only pass through). Does this not work?<br>
> When i tried seeing what read requests were coming then i saw that when i<br>
> issue dd with count=1 it retrieves 4 pages,<br>
> so i tried with 'direct' flag. But even with direct io my read performance<br>
> is way lower than my write performance.<br>
><br>
> Regards,<br>
> Neha<br>
><br>
><br>
> On Wed, Apr 10, 2013 at 11:15 PM, Rajat Sharma <<a href="mailto:fs.rajat@gmail.com" target="_blank">fs.rajat@gmail.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> On Thu, Apr 11, 2013 at 2:23 AM, neha naik <<a href="mailto:nehanaik27@gmail.com" target="_blank">nehanaik27@gmail.com</a>> wrote:<br>
>> > Hi All,<br>
>> > Nobody has replied to my query here. So i am just wondering if there<br>
>> > is a<br>
>> > 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>
>> > ---------- Forwarded message ----------<br>
>> > From: neha naik <<a href="mailto:nehanaik27@gmail.com" target="_blank">nehanaik27@gmail.com</a>><br>
>> > Date: Tue, Apr 9, 2013 at 10:18 AM<br>
>> > Subject: Passthrough device driver performance is low on reads compared<br>
>> > to<br>
>> > writes<br>
>> > To: <a href="mailto:kernelnewbies@kernelnewbies.org" target="_blank">kernelnewbies@kernelnewbies.org</a><br>
>> ><br>
>> ><br>
>> > Hi All,<br>
>> > I have written a passthrough block device driver using 'make_request'<br>
>> > call. This block device driver simply passes any request that comes to<br>
>> > it<br>
>> > down to lvm.<br>
>> ><br>
>> > However, the read performance for my passthrough driver is around 65MB/s<br>
>> > (measured through dd) and write performance is around 140MB/s for dd<br>
>> > block<br>
>> > size 4096.<br>
>> > The write performance matches with lvm's write performance more or less<br>
>> > but,<br>
>> > 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(<br>
>> > 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>
>><br>
>> What is the implementation for sbd_merge_bvec_fn? Please debug through<br>
>> it to check requests are merging or not? May be that is the cause of<br>
>> lower performance?<br>
>><br>
>> > Now, I browsed through dm code in kernel to see if there is some flag or<br>
>> > something which i am not using which is causing this huge performance<br>
>> > penalty.<br>
>> > But, I have not found anything.<br>
>> ><br>
>> > If you have any ideas about what i am possibly doing wrong then please<br>
>> > tell<br>
>> > me.<br>
>> ><br>
>> > Thanks in advance.<br>
>> ><br>
>> > Regards,<br>
>> > Neha<br>
>> ><br>
>><br>
>> -Rajat<br>
>><br>
>> ><br>
>> > _______________________________________________<br>
>> > Kernelnewbies mailing list<br>
>> > <a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
>> > <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>