qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 03/10] migration: stop decompression to alloc


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [PATCH v2 03/10] migration: stop decompression to allocate and free memory frequently
Date: Thu, 29 Mar 2018 11:43:07 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0



On 03/28/2018 05:42 PM, Peter Xu wrote:
On Tue, Mar 27, 2018 at 05:10:36PM +0800, address@hidden wrote:

[...]

+static int compress_threads_load_setup(void)
+{
+    int i, thread_count;
+
+    if (!migrate_use_compression()) {
+        return 0;
+    }
+
+    thread_count = migrate_decompress_threads();
+    decompress_threads = g_new0(QemuThread, thread_count);
+    decomp_param = g_new0(DecompressParam, thread_count);
+    qemu_mutex_init(&decomp_done_lock);
+    qemu_cond_init(&decomp_done_cond);
+    for (i = 0; i < thread_count; i++) {
+        if (inflateInit(&decomp_param[i].stream) != Z_OK) {
+            goto exit;
+        }
+        decomp_param[i].stream.opaque = &decomp_param[i];

Same question as the encoding patch here, otherwise looks good to me.

Thanks for you pointed out, will fix.

Hmm, can i treat it as your Reviewed-by for the next version?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]