ntdll: make msync() call asynchronous in NtFlushVirtualMemory (try 3)

Mathis Beer default_357-line at yahoo.de
Thu Jun 20 06:59:48 CDT 2013


Fixes bug 33146. Path of Exile's updater runs extremely slow (factor of 1000 compared to Windows) due to frequent FlushViewOfFile calls. FlushViewOfFile calls NtFlushVirtualMemory, which calls msync with MS_SYNC. FlushViewOfFile is the only function that calls NtFlushVirtualMemory in Wine, and is specified in the MSDN as asynchronous (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366563%28v=vs.85%29.aspx ).

> The FlushViewOfFile function does not flush the file metadata, and it does not wait to return until the changes are flushed from the underlying hardware disk cache and physically written to disk.

As such, this patch changes msync to be called asynchronously.

This is revision three of this patch. It leaves the original #define MS_SYNC 0 in place and instead changes NtFlushVirtualMemory to use MS_ASYNC only if mman.h was found earlier. (It also adds comments)

---
 dlls/ntdll/virtual.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-bug-33146-call-msync-with-MS_ASYNC-if-mman.h-ava.patch
Type: text/x-patch
Size: 1386 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130620/ca205cbb/attachment.bin>


More information about the wine-patches mailing list