RE: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-12-15 Thread Dexuan Cui
m>; KY Srinivasan > <k...@microsoft.com>; Cathy Avery <cav...@redhat.com> > Subject: Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set > > Ming Lei <tom.leim...@gmail.com> writes: > > > On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei

RE: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-12-15 Thread Dexuan Cui
n Williams ; Martin K. > Petersen ; Sagi Grimberg > ; Mike Snitzer ; KY Srinivasan > ; Cathy Avery > Subject: Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set > > Ming Lei writes: > > > On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei wrote: > >&g

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-04-20 Thread Vitaly Kuznetsov
Ming Lei writes: > On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei wrote: >> On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: >>> On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: Keith Busch

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-04-20 Thread Vitaly Kuznetsov
Ming Lei writes: > On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei wrote: >> On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: >>> On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: Keith Busch writes: > been combined. In any case, I think you can get what you're after

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-30 Thread Ming Lei
On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei wrote: > On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: >> On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: >>> Keith Busch writes: >>> > been combined. In any

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-30 Thread Ming Lei
On Fri, Mar 18, 2016 at 10:59 AM, Ming Lei wrote: > On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: >> On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: >>> Keith Busch writes: >>> > been combined. In any case, I think you can get what you're after just >>> > by moving the

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Keith Busch
On Wed, Mar 16, 2016 at 05:26:28PM +0100, Vitaly Kuznetsov wrote: > Ming Lei writes: > > We do have the above merge in bio_add_page(), so the two bios in > > your above example shouldn't have been observed if the two buffers > > are added to bio via the bio_add_page(). > >

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Keith Busch
On Wed, Mar 16, 2016 at 05:26:28PM +0100, Vitaly Kuznetsov wrote: > Ming Lei writes: > > We do have the above merge in bio_add_page(), so the two bios in > > your above example shouldn't have been observed if the two buffers > > are added to bio via the bio_add_page(). > > > > If you see short

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Vitaly Kuznetsov
Keith Busch writes: > On Wed, Mar 16, 2016 at 05:26:28PM +0100, Vitaly Kuznetsov wrote: >> Ming Lei writes: >> > We do have the above merge in bio_add_page(), so the two bios in >> > your above example shouldn't have been observed if the two buffers

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Vitaly Kuznetsov
Keith Busch writes: > On Wed, Mar 16, 2016 at 05:26:28PM +0100, Vitaly Kuznetsov wrote: >> Ming Lei writes: >> > We do have the above merge in bio_add_page(), so the two bios in >> > your above example shouldn't have been observed if the two buffers >> > are added to bio via the bio_add_page().

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Ming Lei
On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: > On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: >> Keith Busch writes: >> > been combined. In any case, I think you can get what you're after just >> > by moving the gap check

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Ming Lei
On Fri, Mar 18, 2016 at 12:39 AM, Keith Busch wrote: > On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: >> Keith Busch writes: >> > been combined. In any case, I think you can get what you're after just >> > by moving the gap check after BIOVEC_PHYS_MERGABLE. Does the following

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Keith Busch
On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: > Keith Busch writes: > > been combined. In any case, I think you can get what you're after just > > by moving the gap check after BIOVEC_PHYS_MERGABLE. Does the following > > look ok to you? > > > > Thanks,

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Keith Busch
On Thu, Mar 17, 2016 at 12:20:28PM +0100, Vitaly Kuznetsov wrote: > Keith Busch writes: > > been combined. In any case, I think you can get what you're after just > > by moving the gap check after BIOVEC_PHYS_MERGABLE. Does the following > > look ok to you? > > > > Thanks, it does. Cool, thanks

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Ming Lei
On Tue, Mar 15, 2016 at 11:17 PM, Vitaly Kuznetsov wrote: > Hyper-V storage driver, which switched to using virt_boundary some time > ago, experiences significant slowdown on non-page-aligned IO. E.g. > > With virt_boundary set: > # time mkfs.ntfs -Q -s 512 /dev/sdc1 > ...

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Ming Lei
On Tue, Mar 15, 2016 at 11:17 PM, Vitaly Kuznetsov wrote: > Hyper-V storage driver, which switched to using virt_boundary some time > ago, experiences significant slowdown on non-page-aligned IO. E.g. > > With virt_boundary set: > # time mkfs.ntfs -Q -s 512 /dev/sdc1 > ... > real 0m9.406s >

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Vitaly Kuznetsov
Ming Lei writes: > On Tue, Mar 15, 2016 at 11:17 PM, Vitaly Kuznetsov > wrote: >> Hyper-V storage driver, which switched to using virt_boundary some time >> ago, experiences significant slowdown on non-page-aligned IO. E.g. >> >> With virt_boundary

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-19 Thread Vitaly Kuznetsov
Ming Lei writes: > On Tue, Mar 15, 2016 at 11:17 PM, Vitaly Kuznetsov > wrote: >> Hyper-V storage driver, which switched to using virt_boundary some time >> ago, experiences significant slowdown on non-page-aligned IO. E.g. >> >> With virt_boundary set: >> # time mkfs.ntfs -Q -s 512 /dev/sdc1

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-16 Thread Vitaly Kuznetsov
Keith Busch writes: > On Tue, Mar 15, 2016 at 04:17:56PM +0100, Vitaly Kuznetsov wrote: >> The reason of the slowdown is the fact that bios don't get merged and we >> end up sending many short requests to the host. My investigation led me to >> the following code

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-16 Thread Vitaly Kuznetsov
Keith Busch writes: > On Tue, Mar 15, 2016 at 04:17:56PM +0100, Vitaly Kuznetsov wrote: >> The reason of the slowdown is the fact that bios don't get merged and we >> end up sending many short requests to the host. My investigation led me to >> the following code (__bvec_gap_to_prev()): >> >>

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-15 Thread Keith Busch
On Tue, Mar 15, 2016 at 04:17:56PM +0100, Vitaly Kuznetsov wrote: > The reason of the slowdown is the fact that bios don't get merged and we > end up sending many short requests to the host. My investigation led me to > the following code (__bvec_gap_to_prev()): > > return offset || >

Re: [PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-15 Thread Keith Busch
On Tue, Mar 15, 2016 at 04:17:56PM +0100, Vitaly Kuznetsov wrote: > The reason of the slowdown is the fact that bios don't get merged and we > end up sending many short requests to the host. My investigation led me to > the following code (__bvec_gap_to_prev()): > > return offset || >

[PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-15 Thread Vitaly Kuznetsov
Hyper-V storage driver, which switched to using virt_boundary some time ago, experiences significant slowdown on non-page-aligned IO. E.g. With virt_boundary set: # time mkfs.ntfs -Q -s 512 /dev/sdc1 ... real 0m9.406s user 0m0.014s sys0m0.672s Without virt_boundary set (unsafe): #

[PATCH RFC] block: fix bio merge checks when virt_boundary is set

2016-03-15 Thread Vitaly Kuznetsov
Hyper-V storage driver, which switched to using virt_boundary some time ago, experiences significant slowdown on non-page-aligned IO. E.g. With virt_boundary set: # time mkfs.ntfs -Q -s 512 /dev/sdc1 ... real 0m9.406s user 0m0.014s sys0m0.672s Without virt_boundary set (unsafe): #