From: Dan Williams <dan.j.williams@intel.com>
To: qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Xiao Guangrong <guangrong.xiao@gmail.com>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Dan Williams <dan.j.williams@intel.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment
Date: Fri, 26 May 2017 07:24:26 -0700 [thread overview]
Message-ID: <CAPcyv4hbf0RrjK5t5eN2Cs271JJUEYuiDNZqvso8g7QG4m4hDw@mail.gmail.com> (raw)
In-Reply-To: <20170526071654.kxcqflvpo2tvcrvu@hz-desktop>
On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang
<haozhong.zhang@intel.com> wrote:
> On 05/26/17 07:05 +0000, Marc-André Lureau wrote:
>> Hi
>>
>> On Fri, May 26, 2017 at 10:51 AM Haozhong Zhang <haozhong.zhang@intel.com>
>> wrote:
>>
>> > On 05/26/17 06:39 +0000, Marc-André Lureau wrote:
>> > > Hi
>> > >
>> > > On Fri, May 26, 2017 at 6:34 AM Haozhong Zhang <haozhong.zhang@intel.com
>> > >
>> > > wrote:
>> > >
>> > > > file_ram_alloc() currently maps the backend file via mmap to a virtual
>> > > > address aligned to the value returned by qemu_fd_getpagesize(). When a
>> > > > DAX device (e.g. /dev/dax0.0) is used as the backend file, its kernel
>> > > > mmap implementation may require an alignment larger than what
>> > > > qemu_fd_get_pagesize() returns (e.g. 2MB vs. 4KB), and mmap may fail.
>> > > >
>> > >
>> > > How is the accepted value queried? Any chance to configure it
>> > > automatically?
>> >
>> > Take /dev/dax0.0 for example. The value can be read from
>> > /sys/class/dax/dax0.0/device/dax_region/align.
>> >
>>
>> Should this work be left to management layer, or could qemu figure it out
>> by itself (using udev?)
>>
>
> For DAX device only, QEMU can figure out the proper alignment by
> itself. However, I'm not sure whether there are other non-DAX cases
> requiring non-default alignment, so I think it's better to just add an
> interface (i.e. align attribute) in QEMU and let other management
> tools (e.g. libvirt?) fill a proper value.
I can't imagine any cases where you would want to specify an
alignment. If it's regular file mmap any alignment is fine, and if
it's device-dax only the configured alignment of the device instance
is allowed. So, I don't think this should be a configurable option,
just read it from the device instance and you're done.
next prev parent reply other threads:[~2017-05-26 14:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 2:32 [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device Haozhong Zhang
2017-05-26 2:32 ` [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment Haozhong Zhang
2017-05-26 6:39 ` Marc-André Lureau
[not found] ` <20170526065132.ayapfebbft5lyigd@hz-desktop>
2017-05-26 7:05 ` Marc-André Lureau
[not found] ` <20170526071654.kxcqflvpo2tvcrvu@hz-desktop>
2017-05-26 14:24 ` Dan Williams [this message]
2017-05-26 18:55 ` Eduardo Habkost
2017-05-26 20:50 ` Dan Williams
2017-05-27 1:04 ` Haozhong Zhang
2017-05-30 12:17 ` Paolo Bonzini
2017-05-30 19:16 ` Dan Williams
2017-05-26 3:34 ` [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device Dan Williams
2017-05-26 4:30 ` Haozhong Zhang
2017-05-26 14:28 ` Dan Williams
2017-05-26 14:38 ` Daniel P. Berrange
2017-05-26 15:25 ` Dan Williams
2017-05-27 1:13 ` Haozhong Zhang
2017-05-30 9:20 ` Daniel P. Berrange
2017-05-30 11:41 ` Dan Williams
2017-06-01 12:00 ` Xiao Guangrong
2017-06-01 13:53 ` Dan Williams
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=CAPcyv4hbf0RrjK5t5eN2Cs271JJUEYuiDNZqvso8g7QG4m4hDw@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=crosthwaite.peter@gmail.com \
--cc=ehabkost@redhat.com \
--cc=guangrong.xiao@gmail.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@gmail.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).