On 02/07/2011 01:19 PM, richard -rw- weinberger wrote: > Hi, > > Can KSM (http://lwn.net/Articles/306704/) help LXC? > I guess there are a lot of identical pages when logs of containers are > running. >
Some of it we get for free by building on top of chroot instead of kvm. If your binaries live on the same mount point, then they should share executable pages just like normal binaries, despite being in different containers. (Multiple namespaces aside, if you mmap() the same inode out of the same superblock, you should get the same page cache. You may have a read only or copy on write mapping to it, but that's nothing new. That's why shared libraries are -fPIC in the first place.) And similarly, disk cache is also just page cache, based on the underlying files sharing an inode, so exposing the same mount points (either read only or with union mounts on top) in different containers gives you automatic memory sharing the same way it does for the rest of the kernel. But if you copy your root filesystem a lot without hard linking together the underlying inodes, then the underlying disk storage is redundant and thus mmap() of that storage will also be redundant. So doing that not only wastes disk space, but physical memory as well. Rob ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel