[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/8] spapr: drop reference on child object durin
From: |
Bharata B Rao |
Subject: |
Re: [Qemu-devel] [PATCH 1/8] spapr: drop reference on child object during core realization |
Date: |
Thu, 30 Jun 2016 09:57:58 +0530 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jun 29, 2016 at 10:50:20PM +0200, Greg Kurz wrote:
> When a core is being realized, we create a child object for each thread
> of the core.
>
> The child is first initialized with object_initialize() which sets its ref
> count to 1, and then added to the core with object_property_add_child()
> which bumps the ref count to 2.
>
> When the core gets released, object_unparent() decreases the ref count to 1,
> and we g_free() the object: we hence loose the reference on an unfinalized
> object. This is likely to cause random crashes.
>
> Let's drop the extra reference as soon as we don't need it, after the
> thread is added to the core.
>
> Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Bharata B Rao <address@hidden>
- [Qemu-devel] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 1/8] spapr: drop reference on child object during core realization, Greg Kurz, 2016/06/29
- Re: [Qemu-devel] [PATCH 1/8] spapr: drop reference on child object during core realization,
Bharata B Rao <=
- [Qemu-devel] [PATCH 2/8] spapr: do proper error propagation in spapr_cpu_core_realize_child(), Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 3/8] spapr: drop duplicate variable in spapr_core_release(), Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 4/8] exec: add missing conditional compilation, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 5/8] exec: move cpu_index init and exit to their own function, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 6/8] ppc: move cpu index setup to instance_init/finalize, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 7/8] cpu: add initialization helper without realize, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 8/8] hw/ppc: move DT cpu id generation to machine code, Greg Kurz, 2016/06/29
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29