On Mon, Feb 6, 2012 at 10:35 PM, Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> wrote: > My guess is you end up with 2 copies of each page on the guest: the copy in > the guest's page cache, and the copy in the buffer you allocated. From the > perspective of the host this all looks like anonymous memory, so ksm merges > the pages. Yes, the result definitely shows that there two copies. But I don't understand why there would be two copies. So whenever you allocate memory in a guest OS, you will always create two copies of the same memory? An interesting thing is, if I replace the posix_memalign() function with the malloc() function (See the original program, the commented line.) there would be only one copy, i.e., no merging happens, however, since I need to have some page-aligned memory, that's why I use posix_memalign(). Regards Jidong _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization