[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 00/50] tcg tb_lock removal
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH v6 00/50] tcg tb_lock removal |
Date: |
Fri, 20 Oct 2017 22:34:10 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Fri, Oct 20, 2017 at 09:10:38 +0200, Paolo Bonzini wrote:
> >> 2) in tb_for_each_tagged_safe, could the "prev" argument instead be
> >> "next", like
> >
> > Is this just to make them closer to the macros in queue.h?
> >
> > In this case tracking *prev in the loop (rather than next) is
> > useful because it makes removing the "current" element very simple:
>
> This actually makes a lot of sense. Maybe we should change queue.h the
> other way. ;)
Turns out this works here but it isn't as general-purpose as it
might look. In this case it works because we don't free the tb. If
we did, then we'd either need a branch in the iterator or a third
*next pointer.
In fact, the macro wouldn't be safe even if it tracked *next, since
on a removal *pprev must not be updated to the removed item.
IOW, the caller must be the one keeping track of *pprev, for otherwise
things break after the first removal. (Again, this doesn't affect this
particular instance, because its only caller stops iterating after
a removal.)
I have therefore given up on the macro and changed its only caller to
update *pprev. IMO it's less pretty, but more robust.
The updated branch with the changes you suggested (plus the above) is
available at:
https://github.com/cota/qemu/tree/multi-tcg-v6-plus2
Thanks,
Emilio
- Re: [Qemu-devel] [PATCH v6 46/50] tcg: allocate optimizer temps with tcg_malloc, (continued)
- [Qemu-devel] [PATCH v6 42/50] tcg: define tcg_init_ctx and make tcg_ctx a pointer, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 49/50] tcg: introduce regions to split code_gen_buffer, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 50/50] tcg: enable multiple TCG contexts in softmmu, Richard Henderson, 2017/10/16
- Re: [Qemu-devel] [PATCH v6 00/50] tcg tb_lock removal, no-reply, 2017/10/16
- Re: [Qemu-devel] [PATCH v6 00/50] tcg tb_lock removal, Emilio G. Cota, 2017/10/18
- Re: [Qemu-devel] [PATCH v6 00/50] tcg tb_lock removal, Emilio G. Cota, 2017/10/18