[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 12/13] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread()
- To: Philippe Mathieu-Daudé <philippe.mathieu.daude@xxxxxxxxx>, qemu-devel@xxxxxxxxxx
- From: Mark Kanda <mark.kanda@xxxxxxxxxx>
- Date: Wed, 23 Mar 2022 12:30:03 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wKI/gJwiIO07G6Bm4xdEtvjsCv0j2LG8UMWtAshBcSc=; b=e+1abBfcWzmpdVh7si2q8UlNP3ugmiJR51o1d8XyD7D5s8xgKHQUClmpmDXnSnCdtBM+7WFGzldGDcBjG7Ccy7sfMxV7nCB6uaoYGCoxiACaAM2u3F1GCb5bnp8VbykVEnBc4FbAZu/OioNM0rt/Urc1HRzlVnFH32RhIWHCWb7H6nMr/IpzgemnECS69R1ST63XWOWOV6XYpgPVlWgWvMd2Ih3WrRh4IgZeJ3AnTYfhxc/ilSaDQoC6cd9Fp36KPKwuLcuooNYPJnKrh/Y3ofqfoECVparA+q3FlcpM25IX5iPxX313+rsEcmRsDp02Gl8Ip2uB3X+IMq9gumvt8Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iKyC4FFred0W4aOyj/U8CVeDnj4+mD+0gufY1PPlvqfZcaWgmVx9tf7nb+YsKjR7WNIej9k6UtXOSWi4R2fhKi12+lXuJ5iBRMQKeqBFnwvZo1mPu6cfaUGgs+N7IJ1VKi5UQqadNGIvvjco4p6DlABv9NCE4o0F0SeiLWS7Zg9bxqrN+Rj0N7VW9jhSS0gZf1QmiP8h6XArfWf5M0qFvsY0h/zBHXgCFJy+EEMee2hQfsv/ZoqAtFHBQBPHHdQlKCWl9T3h/LbYJ6VtMtpUszVmFd3NEbfDxT9ujfh2q6iycPqG2uG9Ds0ojRsnj7hcCtpDxOMn8o91Q3zVR0NVQA==
- Cc: Wenchao Wang <wenchao.wang@xxxxxxxxx>, Laurent Vivier <lvivier@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Yanan Wang <wangyanan55@xxxxxxxxxx>, Cameron Esfahani <dirty@xxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, haxm-team@xxxxxxxxx, Paul Durrant <paul@xxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, Roman Bolshakov <r.bolshakov@xxxxxxxxx>, Reinoud Zandijk <reinoud@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Kamil Rytarowski <kamil@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Colin Xu <colin.xu@xxxxxxxxx>
- Delivery-date: Thu, 24 Mar 2022 05:12:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Thanks Philippe,
In the patch subject, 'generic_destroy_vcpu_thread()' should be changed to
'common_vcpu_thread_destroy()'.
Same goes for the next patch (Free cpu->halt_cond).
Thanks/regards,
-Mark
On 3/23/2022 12:17 PM, Philippe Mathieu-Daudé wrote:
From: Mark Kanda <mark.kanda@xxxxxxxxxx>
Free cpu->thread in a new AccelOpsClass::destroy_vcpu_thread() handler
generic_destroy_vcpu_thread().
vCPU hotunplug related leak reported by Valgrind:
==102631== 8 bytes in 1 blocks are definitely lost in loss record 1,037 of
8,555
==102631== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117)
==102631== by 0x69EE4CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4)
==102631== by 0x92443A: kvm_start_vcpu_thread (kvm-accel-ops.c:68)
==102631== by 0x4505C2: qemu_init_vcpu (cpus.c:643)
==102631== by 0x76B4D1: x86_cpu_realizefn (cpu.c:6520)
==102631== by 0x9344A7: device_set_realized (qdev.c:531)
==102631== by 0x93E329: property_set_bool (object.c:2273)
==102631== by 0x93C2F8: object_property_set (object.c:1408)
==102631== by 0x940796: object_property_set_qobject (qom-qobject.c:28)
==102631== by 0x93C663: object_property_set_bool (object.c:1477)
==102631== by 0x933D3B: qdev_realize (qdev.c:333)
==102631== by 0x455EC4: qdev_device_add_from_qdict (qdev-monitor.c:713)
Signed-off-by: Mark Kanda <mark.kanda@xxxxxxxxxx>
Message-Id: <20220321141409.3112932-3-mark.kanda@xxxxxxxxxx>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
---
softmmu/cpus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 37325b3b8d..efa8397f04 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -619,6 +619,7 @@ static void common_vcpu_thread_create(CPUState *cpu)
static void common_vcpu_thread_destroy(CPUState *cpu)
{
+ g_free(cpu->thread);
}
void cpu_remove_sync(CPUState *cpu)
|