From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHLP4-0000W3-6S for qemu-devel@nongnu.org; Sun, 06 Dec 2009 13:00:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHLOz-0000Ui-Lm for qemu-devel@nongnu.org; Sun, 06 Dec 2009 13:00:13 -0500 Received: from [199.232.76.173] (port=48122 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHLOz-0000Uf-Fn for qemu-devel@nongnu.org; Sun, 06 Dec 2009 13:00:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40448) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHLOy-0002Yi-Nv for qemu-devel@nongnu.org; Sun, 06 Dec 2009 13:00:09 -0500 Message-ID: <4B1BF10B.3030007@redhat.com> Date: Sun, 06 Dec 2009 19:59:39 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B193DA5.6040507@codemonkey.ws> <4B1A9359.8080305@redhat.com> <4B1A9BF4.2090909@redhat.com> <4B1AE7E3.9000905@collabora.co.uk> <4B1AE8BA.7050207@redhat.com> <4B1AEBE0.4060204@collabora.co.uk> <4B1BACAF.5050203@redhat.com> <4B1BE2BD.900@collabora.co.uk> <4B1BE4DA.4000209@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Blue Swirl , qemu-devel@nongnu.org, Ian Molton , Paul Brook , Markus Armbruster On 12/06/2009 07:47 PM, malc wrote: > >> It will never fail on Linux. On other hosts it prevents a broken oom handler >> from taking the guest down a death spiral. >> > It fails here all the time i'm sorry to say, i have overcommit disabled > (mostly because kpdf when doing a text search tends to overwhelm the VM > subsystem and Linux happily picks X11 as it's OOM kill target) > Right, I meant under the default configuration. Unfortunately there is no good configuration for Linux - without strict overcommit you'll invoke the oom killer, with strict overcommit you'll need ridiculous amounts of swap because fork() and MAP_PRIVATE require tons of backing store. On my home machine I have $ grep Commit /proc/meminfo CommitLimit: 7235160 kB Committed_AS: 4386172 kB So, 4GB of virtual memory needed just to run a normal desktop with thunderbird+firefox. Actual anonymous memory is less than 2GB, so you could easily run this workload on a 2GB machine without swap, but with strict overcommit 2GB RAM + 2GB swap will see failures even though you have free RAM. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.