From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gordan Bobic Subject: KSM For All Via LD_PRELOAD? Date: Tue, 08 Jun 2010 19:43:07 +0100 Message-ID: <4C0E8F3B.5060501@bobich.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from 78-86-195-86.zone2.bethere.co.uk ([78.86.195.86]:54891 "EHLO sentinel1.shatteredsilicon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754087Ab0FHSxO (ORCPT ); Tue, 8 Jun 2010 14:53:14 -0400 Received: from thinkpad.shatteredsilicon.net (unknown [10.255.20.6]) by sentinel1.shatteredsilicon.net (Postfix) with ESMTP id 107A3F87C4 for ; Tue, 8 Jun 2010 19:43:09 +0100 (BST) Sender: kvm-owner@vger.kernel.org List-ID: Is this plausible? I'm trying to work out if it's even worth considering this approach to enable all memory used by in a system to be open to KSM page merging, rather than only memory used by specific programs aware of it (e.g. kvm/qemu). Something like this would address the fact that container based virtualization (OpenVZ, VServer, LXC) cannot benefit from KSM. What I'm thinking about is somehow intercepting malloc() and wrapping it so that all malloc()-ed memory gets madvise()-d as well. Has this been done? Or is this too crazy an idea? Gordan