qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to s


From: Haozhong Zhang
Subject: Re: [Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment
Date: Wed, 31 May 2017 14:24:07 +0800
User-agent: NeoMutt/20170428 (1.8.2)

On 05/30/17 10:16 +0100, Stefan Hajnoczi wrote:
> On Fri, May 26, 2017 at 10:24:38AM +0800, Haozhong Zhang 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.
> > 
> > This commit adds an attribute 'align' to hostmem-file, so that users
> > can specify a proper alignment that satisfies the kernel requirement.
> > 
> > If 'align' is not specified or is 0, the value returned by
> > qemu_fd_get_pagesize() will be used as before.
> 
> How are users supposed to determine alignment requirements?

As discussed in another thread [1,2], the alignment of device-dax can
be got from /sys/dev/char/$major:$minor/device/align, and I'll let
QEMU read the value from it instead of user input.

[1] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg06235.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg06189.html

Haozhong



reply via email to

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