[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set |
Date: |
Wed, 11 Mar 2015 12:57:01 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, 03/10 12:14, Paolo Bonzini wrote:
>
>
> On 10/03/2015 08:50, Fam Zheng wrote:
> > + QLIST_ENTRY(BounceBuffer) next;
>
> Where is this used?
Unused, I will remove this.
>
> > - 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.
This is a good point, it is dangerous to allow that.
>
> Is it hard to do this while keeping map_clients?
We might need to keep map_client for above reason. I'll take another look into
it.
Fam