http://bugs.winehq.org/show_bug.cgi?id=31209
Bug #: 31209 Summary: Feature Request - Kernel Samepage Merging Product: Wine Version: unspecified Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: 7WCbywQg3N2H@dyweni.com Classification: Unclassified
I am playing a game (EVE Online) under Wine 1.5.8 and it consumes roughly 750MB to 1GB. I think a lot of that memory is static data. Multiple copies of the game can be run simultaneously (multi-boxing).
I would like to know if Wine can take advantage of the kernel's KSM (Kernel Samepage Merging) feature. I know the KVM (Kernel Virtual Machines) already does this.
This would be really awesome to have!!
Thanks!
http://bugs.winehq.org/show_bug.cgi?id=31209
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com Severity|normal |enhancement
--- Comment #1 from Dan Kegel dank@kegel.com 2012-07-13 09:10:17 CDT --- For what it's worth, Microsoft has a similar feature that is on by default in Windows 8:
http://blogs.msdn.com/b/b8/archive/2011/10/07/reducing-runtime-memory-in-win...
Linux's feature is described here: http://www.kernel.org/doc/Documentation/vm/ksm.txt
It might be challenging to get this right, since that document advises against using the feature indiscriminately. You could try it yourself by e.g. adding madvise(base, size, MADV_MERGEABLE); into NtAllocateVirtualMemory() in dlls/ntdll/virtual.c.
http://bugs.winehq.org/show_bug.cgi?id=31209
7WCbywQg3N2H@dyweni.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |7WCbywQg3N2H@dyweni.com
--- Comment #2 from 7WCbywQg3N2H@dyweni.com --- Created attachment 48143 --> http://bugs.winehq.org/attachment.cgi?id=48143 Part 1 of 2 - Patch to enable KSM in WINE - Works with Wine 1.7.16
http://bugs.winehq.org/show_bug.cgi?id=31209
--- Comment #3 from 7WCbywQg3N2H@dyweni.com --- Created attachment 48144 --> http://bugs.winehq.org/attachment.cgi?id=48144 Part 2 of 2 - Patch to enable KSM in WINE - Works with Wine 1.7.16
http://bugs.winehq.org/show_bug.cgi?id=31209
--- Comment #4 from 7WCbywQg3N2H@dyweni.com --- For what its work, I have been using these two patches (which I developed) with great success.
Using these patches, I can squeeze in one extra instance of Eve Online on my machine (each instance consumes roughly 1GB of memory).
The first introduces the KSM concept to select types of memory, and the second generalizes KSM to apply to all types of memory.
https://bugs.winehq.org/show_bug.cgi?id=31209
Jimmy Garpehäll epaaj89@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |epaaj89@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=31209
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch, | |performance, source CC| |imwellcushtymelike@gmail.co | |m Component|-unknown |ntdll Version|unspecified |1.5.8
https://bugs.winehq.org/show_bug.cgi?id=31209
K1773R K1773R@darkgamex.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |K1773R@darkgamex.ch
https://bugs.winehq.org/show_bug.cgi?id=31209
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=31209
Jactry Zeng jactry92@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jactry92@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=31209
--- Comment #5 from Sebastian Lackner sebastian@fds-team.de --- Since more and more people are subscribing to this bug report - this feature request was also submitted to the wine staging team, and we decided that it doesn't make sense to include it. Samepage merging has a lot of overhead in situations where it is not required, and running the same game multiple times is really more an exception than the usual situation.
Take a look here for the full discussion: https://github.com/wine-compholio/wine-staging/issues/184
When adding such a feature, it should either it be possible to enable/disable it at runtime, or even better use some more intelligent logic to enable it only for pages which are shared across several processes with a high probability.
https://bugs.winehq.org/show_bug.cgi?id=31209
--- Comment #6 from K1773R K1773R@darkgamex.ch --- what about making it a registry option for the beginning?
https://bugs.winehq.org/show_bug.cgi?id=31209
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=31209
--- Comment #7 from Ken Sharp imwellcushtymelike@gmail.com --- Can't the same be achieved with ksm-wrapper? https://github.com/unbrice/ksm_preload