qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in


From: Dmitry Monakhov
Subject: Re: [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign
Date: Mon, 01 Jun 2015 13:34:00 +0300
User-agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu)

Paolo Bonzini <address@hidden> writes:

> On 13/05/2015 18:46, Denis V. Lunev wrote:
>> I agree with this. Kernel guys are aware and may be we will have
>> the fix after a while... I have heard (not tested) that performance
>> loss over multi-queue SSD is around 30%.
>
> I came up with this patch... can you test it with your test case
> (and old QEMU) to see if it works for you?  I don't see much
> improvement, but neither do I see it with new QEMU.
Yes. Improvement is not huge, but it can be detected for old qemu
unpatched kernel: 728 MiB/sec +/- 20Mb
patched kernel  : 748 MiB/sec +/- 10Mb

IMHO patch is not sufficient. We have to correct bio construction inside
direct-io code. I'll be back with the patch.
>
> Paolo
>
> diff --git a/block/bio.c b/block/bio.c
> index f66a4eae16ee..df5bde7ebded 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -705,6 +705,7 @@ static int __bio_add_page(struct request_queue *q, struct 
> bio *bio, struct page
>  {
>       int retried_segments = 0;
>       struct bio_vec *bvec;
> +     int speculative_len;
>  
>       /*
>        * cloned bio must not modify vec list
> @@ -712,7 +713,16 @@ static int __bio_add_page(struct request_queue *q, 
> struct bio *bio, struct page
>       if (unlikely(bio_flagged(bio, BIO_CLONED)))
>               return 0;
>  
> -     if (((bio->bi_iter.bi_size + len) >> 9) > max_sectors)
> +     /*
> +      * If the bio is not page-aligned, stop if we cannot fit this entire
> +      * page in the vector.  This is a very large write, so we'd like
> +      * to split it so as to keep the remaining bios aligned.
> +      */
> +     speculative_len = len;
> +     if (bio->bi_iter.bi_size & (PAGE_SIZE - 1) && offset == 0)
> +             speculative_len = PAGE_SIZE;
> +
> +     if (((bio->bi_iter.bi_size + speculative_len) >> 9) > max_sectors)
>               return 0;
>  
>       /*

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]