[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and acce
From: |
Paul Brook |
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 |
User-agent: |
KMail/1.9.9 |
> >>> 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
- [Qemu-devel] [PATCH 0/4] Block DMA helpers, Avi Kivity, 2009/02/04
- [Qemu-devel] [PATCH 1/4] Add a scatter-gather list type and accessors, Avi Kivity, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Anthony Liguori, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Avi Kivity, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Anthony Liguori, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Avi Kivity, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Anthony Liguori, 2009/02/04
- [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Avi Kivity, 2009/02/04
- Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors,
Paul Brook <=
- Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Avi Kivity, 2009/02/05
- Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, M. Warner Losh, 2009/02/04
- Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Anthony Liguori, 2009/02/04
- Re: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors, Paul Brook, 2009/02/04
[Qemu-devel] [PATCH 4/4] Convert IDE to use new dma helpers, Avi Kivity, 2009/02/04
[Qemu-devel] [PATCH 3/4] Introduce block dma helpers, Avi Kivity, 2009/02/04
[Qemu-devel] [PATCH 2/4] Add qemu_iovec_reset(), Avi Kivity, 2009/02/04