From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Dmitry Monakhov <dmonakhov@odin.com>,
qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
"Denis V. Lunev" <den@odin.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign
Date: Wed, 13 May 2015 16:43:42 +0100 [thread overview]
Message-ID: <20150513154342.GB24352@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <5551DA21.7020105@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]
On Tue, May 12, 2015 at 12:46:57PM +0200, Paolo Bonzini wrote:
>
>
> On 12/05/2015 12:19, Denis V. Lunev wrote:
> >
> >
> > hades /vol $ strace -f -e pwrite -e raw=write,pwrite qemu-io -n -c
> > "write -P 0x11 0 64M" ./1.img
> > Process 19326 attached
> > [pid 19326] pwrite(0x6, 0x7fac07fff200, 0x4000000, 0x50000) = 0x4000000
> > <---- 1 GB Write from userspace
>
> FWIW this is 64 MB (as expected).
>
> > wrote 67108864/67108864 bytes at offset 0
> > 64 MiB, 1 ops; 0.2964 sec (215.863 MiB/sec and 3.3729 ops/sec)
> > [pid 19326] +++ exited with 0 +++
> > +++ exited with 0 +++
> > hades /vol $
>
> > 9,0 1 266 74.030359772 19326 Q WS 473095 + 1016 [(null)]
> > 9,0 1 267 74.030361546 19326 Q WS 474111 + 8 [(null)]
> > 9,0 1 268 74.030395522 19326 Q WS 474119 + 1016 [(null)]
> > 9,0 1 269 74.030397509 19326 Q WS 475135 + 8 [(null)]
> >
> > This means, yes, kernel is INEFFECTIVE performing direct IO with
> > not aligned address. For example, without direct IO the pattern is
> > much better.
>
> I think this means that the kernel is DMAing at most 128 pages at a
> time. If the buffer is misaligned, you need 129 pages and the kernel
> then splits the request into a 128 page and a 1 page part.
>
> This looks like a hardware limit, and the kernel probably cannot really
> do anything about it because we requested O_DIRECT. So your patch makes
> sense.
A 64 MB buffer was given in the pwrite() call.
The first and the last 128-page write requests may have partial pages,
but why should the rest not use fully aligned 1024 sector writes?
Maybe the buffer is split by the max sectors per request before the
alignment requirements are considered. It would be more efficient to
first split off the unaligned parts.
So I think the kernel is still doing something suboptimal here.
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-05-13 15:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 13:42 [Qemu-devel] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign Denis V. Lunev
2015-05-04 13:42 ` [Qemu-devel] [PATCH 1/2] block: minimal bounce buffer alignment Denis V. Lunev
2015-05-04 13:42 ` [Qemu-devel] [PATCH 2/2] block: align bounce buffers to page Denis V. Lunev
2015-05-11 14:54 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-05-11 15:32 ` Eric Blake
2015-05-11 15:40 ` Denis V. Lunev
2015-05-11 15:08 ` [Qemu-devel] [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign Stefan Hajnoczi
2015-05-11 16:07 ` Denis V. Lunev
2015-05-11 16:38 ` Denis V. Lunev
2015-05-11 16:47 ` Denis V. Lunev
2015-05-12 10:01 ` Stefan Hajnoczi
2015-05-12 10:19 ` Denis V. Lunev
2015-05-12 10:46 ` Paolo Bonzini
2015-05-13 15:43 ` Stefan Hajnoczi [this message]
2015-05-13 16:46 ` Denis V. Lunev
2015-05-29 16:43 ` [Qemu-devel] " Paolo Bonzini
2015-06-01 10:34 ` Dmitry Monakhov
2015-06-01 10:41 ` Paolo Bonzini
2015-06-01 11:16 ` Dmitry Monakhov
2015-06-01 11:26 ` Paolo Bonzini
2015-06-01 11:57 ` Dmitry Monakhov
2015-05-14 9:13 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150513154342.GB24352@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=den@odin.com \
--cc=dmonakhov@odin.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).