[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v15 1/2] util/mmap-alloc: support MAP_SYNC in qe
From: |
Wei Yang |
Subject: |
Re: [Qemu-devel] [PATCH v15 1/2] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap() |
Date: |
Tue, 30 Apr 2019 22:36:18 +0000 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Tue, Apr 30, 2019 at 05:46:36PM -0300, Eduardo Habkost wrote:
>Hi,
>
>On Fri, Apr 26, 2019 at 08:36:51AM +0800, Wei Yang wrote:
>> From: Zhang Yi <address@hidden>
>>
>> When a file supporting DAX is used as vNVDIMM backend, mmap it with
>> MAP_SYNC flag in addition which can ensure file system metadata
>> synced in each guest writes to the backend file, without other QEMU
>> actions (e.g., periodic fsync() by QEMU).
>>
>> Current, We have below different possible use cases:
>>
>> 1. pmem=on is set, shared=on is set, MAP_SYNC supported:
>> a: backend is a dax supporting file.
>> - MAP_SYNC will active.
>> b: backend is not a dax supporting file.
>> - mmap will trigger a warning. then MAP_SYNC flag will be ignored
>>
>> 2. The rest of cases:
>> - we will never pass the MAP_SYNC to mmap2
>>
>> Signed-off-by: Haozhong Zhang <address@hidden>
>> Signed-off-by: Zhang Yi <address@hidden>
>> [ehabkost: Rebased patch to latest code on master]
>> Signed-off-by: Eduardo Habkost <address@hidden>
>> Signed-off-by: Wei Yang <address@hidden>
>> Tested-by: Wei Yang <address@hidden>
>> Reviewed-by: Stefan Hajnoczi <address@hidden>
>>
>> ---
>> v15: fix compile issue on pre-linux4.15
>> v14: rebase on top of current upstream
>
>Note that v14 was already merged, so the build fix would need to
>be submitted separately. However:
>
Sure, I would spin a separate patch.
>[...]
>> +#ifdef CONFIG_LINUX
>> +#include <linux/mman.h>
>> +#endif /* CONFIG_LINUX */
>> +
>> +#ifndef MAP_SYNC
>> +#define MAP_SYNC 0
>> +#endif
>> +#ifndef MAP_SHARED_VALIDATE
>> +#define MAP_SHARED_VALIDATE 0
>> +#endif
>
>Why would we need this, if we added copies of mman.h to
>linux-headers?
This is reported by Stefan.
https://www.mail-archive.com/address@hidden/msg612168.html
>
>--
>Eduardo
--
Wei Yang
Help you, Help me
[Qemu-devel] [PATCH v15 2/2] docs: Added MAP_SYNC documentation, Wei Yang, 2019/04/25