Re: [Qemu-devel] [RFC 1/2] linux-user: Don't leak cpus on thread exit

2016-07-14 Thread David Gibson
On Thu, Jul 14, 2016 at 03:05:31PM +0200, Igor Mammedov wrote: > On Thu, 14 Jul 2016 22:02:36 +1000 > David Gibson wrote: > > > On Thu, Jul 14, 2016 at 10:52:48AM +0100, Peter Maydell wrote: > > > On 14 July 2016 at 08:57, David Gibson > > > wrote: > > > > Currently linux-user does not correc

Re: [Qemu-devel] [RFC 1/2] linux-user: Don't leak cpus on thread exit

2016-07-14 Thread David Gibson
On Thu, Jul 14, 2016 at 10:52:48AM +0100, Peter Maydell wrote: > On 14 July 2016 at 08:57, David Gibson wrote: > > Currently linux-user does not correctly clean up CPU instances properly > > when running a threaded binary. > > > > On thread exit, do_syscall() removes the thread's CPU from the cpus

Re: [Qemu-devel] [RFC 1/2] linux-user: Don't leak cpus on thread exit

2016-07-14 Thread Igor Mammedov
On Thu, 14 Jul 2016 22:02:36 +1000 David Gibson wrote: > On Thu, Jul 14, 2016 at 10:52:48AM +0100, Peter Maydell wrote: > > On 14 July 2016 at 08:57, David Gibson wrote: > > > > > Currently linux-user does not correctly clean up CPU instances properly > > > when running a threaded binary. > >

Re: [Qemu-devel] [RFC 1/2] linux-user: Don't leak cpus on thread exit

2016-07-14 Thread Peter Maydell
On 14 July 2016 at 08:57, David Gibson wrote: > Currently linux-user does not correctly clean up CPU instances properly > when running a threaded binary. > > On thread exit, do_syscall() removes the thread's CPU from the cpus list > and calls object_unref(). However, the CPU still is still refere

[Qemu-devel] [RFC 1/2] linux-user: Don't leak cpus on thread exit

2016-07-14 Thread David Gibson
Currently linux-user does not correctly clean up CPU instances properly when running a threaded binary. On thread exit, do_syscall() removes the thread's CPU from the cpus list and calls object_unref(). However, the CPU still is still referenced from the QOM tree. To correctly clean up we need t