From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 1/4] Add a scatter-gather list type and accessors
Date: Wed, 04 Feb 2009 23:03:47 +0200 [thread overview]
Message-ID: <498A02B3.4070903@redhat.com> (raw)
In-Reply-To: <4989FF9B.4010809@us.ibm.com>
Anthony Liguori wrote:
>>
>> malloc() will never fail on Linux with overcommit enabled; since
>> Linux is fairly useless without overcommit, it means you'll never see
>> a failure.
>
> Sure it will. You just have to run out of VA space.
>
That's not recoverable, and is certainly a qemu bug if it happens.
Especially on 47-bit hosts.
>>>> I expect this to trigger rarely since the allocation hint should
>>>> suffice nearly 100% of the time. But in case we miss, it's better
>>>> to reallocate as little as possible.
>>>>
>>>> (what I really want is std::vector<>)
>>>
>>> Which I'm pretty sure has a linear growth strategy :-)
>>
>> Not in any of the implementations I'm familiar with. I believe
>> std::vector<> is required to have amortized O(1) append operations.
>
> Linear growth doesn't imply element-by-element growth. You can have a
> coefficient > 1.
>
If you have a coefficient, then it's exponential growth, even if it's
less than two. If you have an addition, then it's linear growth, even
if the addend is greater than one.
size *= k -> exponential
size += k -> linear
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2009-02-04 21:07 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 [this message]
2009-02-04 23:58 ` Paul Brook
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=498A02B3.4070903@redhat.com \
--to=avi@redhat.com \
--cc=aliguori@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.