diff mbox

[2/2] migration: Don't create decompression threads if not enabled

Message ID 20170613095432.11623-3-quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela June 13, 2017, 9:54 a.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

--

I removed the [HACK] part because previous patch just check that
compression pages are not received.
---
 migration/ram.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Peter Xu June 14, 2017, 7:28 a.m. UTC | #1
On Tue, Jun 13, 2017 at 11:54:32AM +0200, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> --
> 
> I removed the [HACK] part because previous patch just check that
> compression pages are not received.
> ---
>  migration/ram.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index f2d1bce..d475cf5 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -2234,6 +2234,9 @@ static void compress_threads_load_setup(void)

I cannot find compress_threads_load_setup() in my repo, but
migrate_decompress_threads_create()?

Thanks,

>  {
>      int i, thread_count;
>  
> +    if (!migrate_use_compression()) {
> +        return;
> +    }
>      thread_count = migrate_decompress_threads();
>      decompress_threads = g_new0(QemuThread, thread_count);
>      decomp_param = g_new0(DecompressParam, thread_count);
> @@ -2255,6 +2258,9 @@ static void compress_threads_load_cleanup(void)
>  {
>      int i, thread_count;
>  
> +    if (!migrate_use_compression()) {
> +        return;
> +    }
>      thread_count = migrate_decompress_threads();
>      for (i = 0; i < thread_count; i++) {
>          qemu_mutex_lock(&decomp_param[i].mutex);
> -- 
> 2.9.4
>
Juan Quintela June 14, 2017, 7:46 a.m. UTC | #2
Peter Xu <peterx@redhat.com> wrote:
> On Tue, Jun 13, 2017 at 11:54:32AM +0200, Juan Quintela wrote:
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>> 
>> --
>> 
>> I removed the [HACK] part because previous patch just check that
>> compression pages are not received.
>> ---
>>  migration/ram.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/migration/ram.c b/migration/ram.c
>> index f2d1bce..d475cf5 100644
>> --- a/migration/ram.c
>> +++ b/migration/ram.c
>> @@ -2234,6 +2234,9 @@ static void compress_threads_load_setup(void)
>
> I cannot find compress_threads_load_setup() in my repo, but
> migrate_decompress_threads_create()?


Sorry, this patches are on top of load_setup/cleanup series.

Later, Juan.

>
> Thanks,
>
>>  {
>>      int i, thread_count;
>>  
>> +    if (!migrate_use_compression()) {
>> +        return;
>> +    }
>>      thread_count = migrate_decompress_threads();
>>      decompress_threads = g_new0(QemuThread, thread_count);
>>      decomp_param = g_new0(DecompressParam, thread_count);
>> @@ -2255,6 +2258,9 @@ static void compress_threads_load_cleanup(void)
>>  {
>>      int i, thread_count;
>>  
>> +    if (!migrate_use_compression()) {
>> +        return;
>> +    }
>>      thread_count = migrate_decompress_threads();
>>      for (i = 0; i < thread_count; i++) {
>>          qemu_mutex_lock(&decomp_param[i].mutex);
>> -- 
>> 2.9.4
>>
Peter Xu June 14, 2017, 7:50 a.m. UTC | #3
On Wed, Jun 14, 2017 at 09:46:50AM +0200, Juan Quintela wrote:
> Peter Xu <peterx@redhat.com> wrote:
> > On Tue, Jun 13, 2017 at 11:54:32AM +0200, Juan Quintela wrote:
> >> Signed-off-by: Juan Quintela <quintela@redhat.com>
> >> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> >> 
> >> --
> >> 
> >> I removed the [HACK] part because previous patch just check that
> >> compression pages are not received.
> >> ---
> >>  migration/ram.c | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >> 
> >> diff --git a/migration/ram.c b/migration/ram.c
> >> index f2d1bce..d475cf5 100644
> >> --- a/migration/ram.c
> >> +++ b/migration/ram.c
> >> @@ -2234,6 +2234,9 @@ static void compress_threads_load_setup(void)
> >
> > I cannot find compress_threads_load_setup() in my repo, but
> > migrate_decompress_threads_create()?
> 
> 
> Sorry, this patches are on top of load_setup/cleanup series.

Got it. After all the content of the patch looks good to me, so please
take my r-b as long as the patch can apply cleanly and correctly on
where it should be based:

Reviewed-by: Peter Xu <peterx@redhat.com>

Thanks,
diff mbox

Patch

diff --git a/migration/ram.c b/migration/ram.c
index f2d1bce..d475cf5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2234,6 +2234,9 @@  static void compress_threads_load_setup(void)
 {
     int i, thread_count;
 
+    if (!migrate_use_compression()) {
+        return;
+    }
     thread_count = migrate_decompress_threads();
     decompress_threads = g_new0(QemuThread, thread_count);
     decomp_param = g_new0(DecompressParam, thread_count);
@@ -2255,6 +2258,9 @@  static void compress_threads_load_cleanup(void)
 {
     int i, thread_count;
 
+    if (!migrate_use_compression()) {
+        return;
+    }
     thread_count = migrate_decompress_threads();
     for (i = 0; i < thread_count; i++) {
         qemu_mutex_lock(&decomp_param[i].mutex);