When a CPU object is created it is parented during it's realize stage.
If we don't unparent before the "final" unref we will never finzalize
the object leading to a memory leak. For most setups you probably
won't notice but with anything that creates and destroys a lot of
threads this will add up. This goes especially for architectures which
allocate a lot of memory in their CPU structures.
When a CPU object is created it is parented during it's realize stage.
If we don't unparent before the "final" unref we will never finzalize
the object leading to a memory leak. For most setups you probably
won't notice but with anything that creates and destroys a lot of
threads this will add up. This goes especially for architectures which
allocate a lot of memory in their CPU structures.
Fixes: https:/ /bugs.launchpad .net/qemu/ +bug/1836558 user/syscall. c | 1 +
Cc: <email address hidden>
Signed-off-by: Alex Bennée <email address hidden>
---
linux-
1 file changed, 1 insertion(+)
diff --git a/linux- user/syscall. c b/linux- user/syscall. c .4c9313fd9d0 100644 user/syscall. c user/syscall. c
NULL, NULL, 0);
thread_ cpu = NULL; unparent( OBJECT( cpu));
object_ unref(OBJECT( cpu));
g_ free(ts) ;
rcu_ unregister_ thread( );
index 39a37496fed.
--- a/linux-
+++ b/linux-
@@ -7183,6 +7183,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
}
+ object_
--
2.20.1