Open grossmj opened 11 years ago
The "Translation Sharing Groups" code in unstable uses a similar concept. It reduces memory by sharing jit-generated code between routers that use the same image.
Unfortunately I don't have any hardware with a processor that supports virtualization technology, therefore I can't play around with KSM. This issue is postponed.
The point of wanting KSM is not in a single dynamips process, but to be able to share across all of them. For example if I have 50+ routers loaded, they are going to be spread over many processes, and those can easily share similar memory between them.
Also, all that is really needed is the memory used by the images to be marked as MADV_MERGABLE.
It's good to know that it's easy to implement. I won't code it since I can't test it, but I'll accept a patch or pull request if anyone is willing to code it. :wink:
To my knowledge, KSM has no such requirement for VT extensions. I think you might be conflating KSM and KVM, due to how KSM originally came about. The KSM functionality is completely in kernel, and included in mainline as of some time ago. Even my ATOM board for example runs it. It just generally isn't turned on because it's rare you run into a situation where you'd benefit from it more than the performance penalty, except in cases of virtualization, which KVM and dynamips effectively are.
After reading this http://www.linux-kvm.com/content/using-ksm-kernel-samepage-merging-kvm I think the implement could be straightforward.
Yeah, it's definitely a simple
madvise(..., MADV_MERGEABLE)
to make different dynamips processes share memory. I, too, would like to see this implemented in a future version :)
Someone on the forum has submitted this idea. Don't know if this is feasible but I find it interesting.
http://forum.gns3.net/topic6391.html