qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors
Date: Wed, 4 Feb 2009 23:58:12 +0000	[thread overview]
Message-ID: <200902042358.13955.paul@codesourcery.com> (raw)
In-Reply-To: <4989FE92.5020400@redhat.com>

> >>> Would be nice to check for malloc failures and fail gracefully at
> >>> least.
> >>
> >> Do you mean an exit(1)?  If so we could just put it in qemu_malloc().
> >
> > In theory, some users may be able to cope with malloc failure.  In
> > practice, I don't think anyone can.  I'm open to suggestion.
>
> malloc() will never fail on Linux with overcommit enabled; since Linux
> is fairly useless without overcommit, it means you'll never see a failure.

I disagree about "Linux is fairly useless without overcommit". Certain common 
linux applications maybe, however...

> Other ways of allocating memory (stack growth, first access to anonymous
> memory) are not covered.  They can fail (most ungracefully) without
> strict overcommit control.
>
> So I suggest to have qemu_malloc() and its friends abort on failure.

I'll support this.  In theory it's sometimes possible to recover from Out Of 
Memory conditions. However in practice I don't think there's any real scope 
for this in qemu.  If were allocating huge chunks of ram on the fly then 
something else is already badly wrong.

IMHO pushing the error up (down?) the callchain is unlikely to provide the 
user with significantly better information, we may as well bail out in 
qemu_malloc.

Paul

  parent reply	other threads:[~2009-02-04 23:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 12:25 [Qemu-devel] [PATCH 0/4] Block DMA helpers Avi Kivity
2009-02-04 12:25 ` [Qemu-devel] [PATCH 1/4] Add a scatter-gather list type and accessors Avi Kivity
2009-02-04 19:27   ` [Qemu-devel] " Anthony Liguori
2009-02-04 20:30     ` Avi Kivity
2009-02-04 20:36       ` Anthony Liguori
2009-02-04 20:46         ` Avi Kivity
2009-02-04 20:50           ` Anthony Liguori
2009-02-04 21:03             ` Avi Kivity
2009-02-04 23:58           ` Paul Brook [this message]
2009-02-05  7:25             ` Avi Kivity
2009-02-05  0:29         ` M. Warner Losh
2009-02-05  1:56           ` Anthony Liguori
2009-02-04 23:49     ` Paul Brook
2009-02-04 12:25 ` [Qemu-devel] [PATCH 2/4] Add qemu_iovec_reset() Avi Kivity
2009-02-04 12:25 ` [Qemu-devel] [PATCH 3/4] Introduce block dma helpers Avi Kivity
2009-02-04 19:29   ` [Qemu-devel] " Anthony Liguori
2009-02-04 12:25 ` [Qemu-devel] [PATCH 4/4] Convert IDE to use new " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902042358.13955.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).