From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set
Date: Tue, 10 Mar 2015 12:14:47 +0100 [thread overview]
Message-ID: <54FED227.40100@redhat.com> (raw)
In-Reply-To: <1425973810-22831-2-git-send-email-famz@redhat.com>
On 10/03/2015 08:50, Fam Zheng wrote:
> + QLIST_ENTRY(BounceBuffer) next;
Where is this used?
> - if (buffer != bounce.buffer) {
> + BounceBuffer *bounce;
> +
> + bounce = bounce_buffer_find_and_remove(buffer);
> + if (!bounce) {
I'm afraid that this adds a mutex lock/unlock pair and a hash table
lookup on a very hot path. One possibility is to add a check that the
hash table is not empty in bounce_buffer_find_and_remove. That can be
done outside the lock so it's fast.
I'm also wondering if it's okay to let the guest do arbitrarily large
memory allocations (e.g. DMA from a huge unassigned memory area above
guest RAM); effectively you're disabling the "/* Avoid unbounded
allocations */" safety guard.
Is it hard to do this while keeping map_clients?
Paolo
next prev parent reply other threads:[~2015-03-10 11:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 7:50 [Qemu-devel] [PATCH 0/2] exec: Convert bounce buffer to a set Fam Zheng
2015-03-10 7:50 ` [Qemu-devel] [PATCH 1/2] " Fam Zheng
2015-03-10 11:14 ` Paolo Bonzini [this message]
2015-03-11 4:57 ` Fam Zheng
2015-03-10 7:50 ` [Qemu-devel] [PATCH 2/2] exec: Remove map_client_list family Fam Zheng
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=54FED227.40100@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@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).