Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760723AbZC3UFA (ORCPT ); Mon, 30 Mar 2009 16:05:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757724AbZC3UEs (ORCPT ); Mon, 30 Mar 2009 16:04:48 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38829 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757802AbZC3UEr (ORCPT ); Mon, 30 Mar 2009 16:04:47 -0400 Message-ID: <49D12564.40708@redhat.com> Date: Mon, 30 Mar 2009 16:02:44 -0400 From: Rik van Riel Organization: Red Hat, Inc User-Agent: Thunderbird 2.0.0.17 (X11/20080915) MIME-Version: 1.0 To: Jeremy Fitzhardinge CC: Dave Hansen , Martin Schwidefsky , akpm@osdl.org, nickpiggin@yahoo.com.au, frankeh@watson.ibm.com, virtualization@lists.osdl.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, hugh@veritas.com Subject: Re: [patch 0/6] Guest page hinting version 7. References: <20090327150905.819861420@de.ibm.com> <1238195024.8286.562.camel@nimitz> <20090329161253.3faffdeb@skybase> <1238428495.8286.638.camel@nimitz> <49D11184.3060002@goop.org> <49D11287.4030307@redhat.com> <49D11674.9040205@goop.org> In-Reply-To: <49D11674.9040205@goop.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1767 Lines: 44 Jeremy Fitzhardinge wrote: > Rik van Riel wrote: >> Jeremy Fitzhardinge wrote: >> >>> That said, people have been looking at tracking block IO to work out >>> when it might be useful to try and share pages between guests under Xen. >> >> Tracking block IO seems like a bass-ackwards way to figure >> out what the contents of a memory page are. > > Well, they're research projects, so nobody said that they're necessarily > useful results ;). I think the rationale is that, in general, there > aren't all that many sharable pages, and asize from zero-pages, the bulk > of them are the result of IO. I'll give you a hint: Windows zeroes out freed pages. It should also be possible to hook up arch_free_page() so freed pages in Linux guests become sharable. Furthermore, every guest with the same OS version will be running the same system daemons, same glibc, etc. This means sharable pages from not just disk IO (probably from different disks anyway), but also in the BSS and possibly even on the heap. >> The KVM KSM code has a simpler, yet still efficient, way of >> figuring out which memory pages can be shared. > How's that? Does it do page content comparison? Eventually. It starts out with hashing the first 128 (IIRC) bytes of page content and comparing the hashes. If that matches, it will do content comparison. Content comparison is done in the background on the host. I suspect (but have not checked) that it is somehow hooked up to the page reclaim code on the host. -- All rights reversed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/