|
| From: | Paolo Bonzini |
| Subject: | Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set |
| Date: | Tue, 10 Mar 2015 12:14:47 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
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
| [Prev in Thread] | Current Thread | [Next in Thread] |