Re: [Qemu-devel] [RFC 3/7] translate-all: use a binary search tree to track TBs in TBContext

2017-06-30 Thread Emilio G. Cota
On Fri, Jun 30, 2017 at 00:49:37 -0700, Richard Henderson wrote: > On 06/30/2017 12:41 AM, Richard Henderson wrote: > >On 06/29/2017 01:28 PM, Emilio G. Cota wrote: > >>+/* @key is already in the tree so it's safe to use container_of on it */ > >>+static gint tc_ptr_cmp(gconstpointer candidate,

Re: [Qemu-devel] [RFC 3/7] translate-all: use a binary search tree to track TBs in TBContext

2017-06-30 Thread Richard Henderson
On 06/30/2017 12:41 AM, Richard Henderson wrote: On 06/29/2017 01:28 PM, Emilio G. Cota wrote: +/* @key is already in the tree so it's safe to use container_of on it */ +static gint tc_ptr_cmp(gconstpointer candidate, gconstpointer key) +{ +uintptr_t a = *(uintptr_t *)candidate; +const

Re: [Qemu-devel] [RFC 3/7] translate-all: use a binary search tree to track TBs in TBContext

2017-06-30 Thread Richard Henderson
On 06/29/2017 01:28 PM, Emilio G. Cota wrote: +/* @key is already in the tree so it's safe to use container_of on it */ +static gint tc_ptr_cmp(gconstpointer candidate, gconstpointer key) +{ +uintptr_t a = *(uintptr_t *)candidate; +const TranslationBlock *tb = container_of(key,

[Qemu-devel] [RFC 3/7] translate-all: use a binary search tree to track TBs in TBContext

2017-06-29 Thread Emilio G. Cota
This is a prerequisite for having threads generate code on separate buffers, which will help scalability when booting multiple cores under MTTCG. Note that tb_free does not free space in the code_gen_buffer anymore, since we cannot easily know whether the tb is the last one inserted in