qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
	agraf@suse.de, qemu-devel@nongnu.org, jfrei@linux.vnet.ibm.com,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH/RFC] block: Ensure that block size constraints are considered
Date: Thu, 22 Nov 2012 13:03:03 +0100	[thread overview]
Message-ID: <50AE1477.9090001@de.ibm.com> (raw)
In-Reply-To: <50ACFB6D.8040106@redhat.com>

On 21/11/12 17:03, Paolo Bonzini wrote:
> Il 21/11/2012 10:15, Kevin Wolf ha scritto:
>>>> +    if ((bs->open_flags & BDRV_O_NOCACHE)) {
>>>> +        bs->file->buffer_alignment = align;
>>>> +    }
>> Any reason to restrict this to BDRV_O_NOCACHE?
>>
>> There have been patches to change the BDRV_O_NOCACHE flag from the
>> monitor, in which case bdrv_set_buffer_alignment() wouldn't be called
>> anew and O_DIRECT requests start to fail again.
>>
> 
> bdrv_set_buffer_alignment() is completely broken.  It should set host
> alignment, but in fact it is passed the guest alignment.
> 
> In practice, we only support logical_block_size matching the host's or
> bigger (which is unsafe due to torn writes, but works).


For other reasons (partition table format) we want to have host block
size == guest block size on s390 anyway - so it would not really matter for
us.
But I certainly agree that it makes more sense to use the host block size
for the alignment checks.



> So I suggest that we just look at writes outside the device models, and
> "fix" them to always read a multiple of 4k.

Wouldnt that cause performance regressions for block devices with 512 byte 
block size, because we read more than necessary. Wouldnt that also require
read/update/write combinations for valid 512 byte writes?

Christian

  reply	other threads:[~2012-11-22 13:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  8:58 [Qemu-devel] [PATCH/RFC] block: Ensure that block size constraints are considered Christian Borntraeger
2012-11-21  9:15 ` Kevin Wolf
2012-11-21 10:00   ` Christian Borntraeger
2012-11-21 11:24     ` Heinz Graalfs
2012-11-21 16:03   ` Paolo Bonzini
2012-11-22 12:03     ` Christian Borntraeger [this message]
2012-11-23 10:45   ` Heinz Graalfs
2012-12-07 20:26   ` Heinz Graalfs
2012-12-10  8:55     ` Kevin Wolf
2012-12-11  9:58       ` Heinz Graalfs
2012-12-11 10:30         ` Kevin Wolf
2012-12-11 13:53           ` Heinz Graalfs

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=50AE1477.9090001@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=graalfs@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).