lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVXFVM9kdz5+eyTuCf=5MuZdQxCMVW1tx6s0GLqugoeBF8jOA@mail.gmail.com>
Date:   Tue, 13 Nov 2018 19:39:36 +0800
From:   Ming Lei <tom.leiming@...il.com>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Jens Axboe <axboe@...nel.dk>,
        linux-block <linux-block@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Christoph Hellwig <hch@....de>
Subject: Re: [PATCH V8 13/18] block: enable multipage bvecs

On Sat, Nov 10, 2018 at 12:29 AM Ming Lei <ming.lei@...hat.com> wrote:
>
> This patch pulls the trigger for multi-page bvecs.
>
> Now any request queue which supports queue cluster will see multi-page
> bvecs.
>
> Cc: Christoph Hellwig <hch@....de>
> Signed-off-by: Ming Lei <ming.lei@...hat.com>
> ---
>  block/bio.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/block/bio.c b/block/bio.c
> index 6486722d4d4b..b2ce42e89076 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -767,12 +767,23 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page,
>
>         if (bio->bi_vcnt > 0) {
>                 struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1];
> -
> -               if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len) {
> -                       bv->bv_len += len;
> -                       bio->bi_iter.bi_size += len;
> -                       return true;
> -               }
> +               struct request_queue *q = NULL;
> +
> +               if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len)
> +                       goto merge;
> +
> +               if (bio->bi_disk)
> +                       q = bio->bi_disk->queue;
> +
> +               /* disable multi-page bvec too if cluster isn't enabled */
> +               if (!q || !blk_queue_cluster(q) ||
> +                   (page_to_phys(bv->bv_page) + bv->bv_offset + bv->bv_len !=
> +                    page_to_phys(page) + off))
> +                       return false;
> + merge:
> +               bv->bv_len += len;
> +               bio->bi_iter.bi_size += len;
> +               return true;
>         }
>         return false;
>  }

This patch caused regression on iomap & xfs for sub-pagesize io vec, which
has been addressed in the following patch:

https://github.com/ming1/linux/commit/46ea6acb175fbc68f98f645f14d77b1b4178e593

Because iomap needs to know if the merged page is one freshly new page, however
__bio_try_merge_page() won't tell us if that is true.

I will post out V9 once the new change passes my tests.

Thanks,
Ming Lei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ