From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6egH-0004gX-9D for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:21:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6egE-0001lu-0e for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:21:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6egD-0001lk-Sg for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:21:13 -0500 Date: Wed, 9 Dec 2015 13:21:09 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20151209132108.GB18106@work-vm> References: <87a8pl9hmt.fsf@blackfin.pond.sub.org> <20151208141938.GB2593@work-vm> <87io480y0n.fsf@blackfin.pond.sub.org> <20151209102931.GC2712@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Error handling in realize() methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Peter Crosthwaite , Markus Armbruster , Andreas =?iso-8859-1?Q?F=E4rber?= , QEMU Developers * Peter Maydell (peter.maydell@linaro.org) wrote: > On 9 December 2015 at 10:29, Dr. David Alan Gilbert wrote: > > (OK, to be honest I think we should protect every allocation - but I do > > have sympathy with the complexity/testing arguments). > > My view on this is that Linux overcommits, so the actual likely > way that "oops, out of memory" will manifest is by some page not > being able to be allocated-on-demand, at which point your process > is toast anyway. Checking malloc returns is really only checking > your virtual address space allocation, which typically speaking > always succeeds, except in the "we tried to get gigabytes at > once" case... We already get some failures, e.g. qemu-system-x86_64 -m 8192 fails with an allocation error on my laptop (8GB RAM+2GB swap). I'm also not sure whether your statement is true once things like cgroup/ulimit memory restrictions are used and/or mlock. People really really hate OOM behaviour in production systems and jump through hoops to try and avoid it. Dave > > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK