diff mbox series

[v1,2/4] migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()

Message ID 20230210063630.532185-2-leobras@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v1,1/4] migration/multifd: Change multifd_load_cleanup() signature and usage | expand

Commit Message

Leonardo Bras Feb. 10, 2023, 6:36 a.m. UTC
Before assigning "p->quit = true" for every multifd channel,
multifd_load_cleanup() will call multifd_recv_terminate_threads() which
already does the same assignment, while protected by a mutex.

So there is no point doing the same assignment again.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
---
 migration/multifd.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Juan Quintela Feb. 10, 2023, 12:48 p.m. UTC | #1
Leonardo Bras <leobras@redhat.com> wrote:
> Before assigning "p->quit = true" for every multifd channel,
> multifd_load_cleanup() will call multifd_recv_terminate_threads() which
> already does the same assignment, while protected by a mutex.
>
> So there is no point doing the same assignment again.
>
> Signed-off-by: Leonardo Bras <leobras@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

good catch
Peter Xu Feb. 10, 2023, 5:19 p.m. UTC | #2
On Fri, Feb 10, 2023 at 03:36:29AM -0300, Leonardo Bras wrote:
> Before assigning "p->quit = true" for every multifd channel,
> multifd_load_cleanup() will call multifd_recv_terminate_threads() which
> already does the same assignment, while protected by a mutex.
> 
> So there is no point doing the same assignment again.
> 
> Signed-off-by: Leonardo Bras <leobras@redhat.com>

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

Patch

diff --git a/migration/multifd.c b/migration/multifd.c
index 174726982c..1a445b36f1 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -1034,7 +1034,6 @@  void multifd_load_cleanup(void)
         MultiFDRecvParams *p = &multifd_recv_state->params[i];
 
         if (p->running) {
-            p->quit = true;
             /*
              * multifd_recv_thread may hung at MULTIFD_FLAG_SYNC handle code,
              * however try to wakeup it without harm in cleanup phase.