From patchwork Wed Aug 4 19:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 12419711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B804C4338F for ; Wed, 4 Aug 2021 19:28:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 954A060BD3 for ; Wed, 4 Aug 2021 19:28:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 954A060BD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBMYy-0004ot-R8 for qemu-devel@archiver.kernel.org; Wed, 04 Aug 2021 15:28:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBMY9-0003Yt-QO for qemu-devel@nongnu.org; Wed, 04 Aug 2021 15:27:34 -0400 Received: from mout.web.de ([212.227.15.14]:39995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBMY6-0001Xz-VB for qemu-devel@nongnu.org; Wed, 04 Aug 2021 15:27:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1628105246; bh=Ozyv2hWhzNzqbGsRLt/k8cyn6gdchEY1Zg8FfHkPhFY=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=W9uOh5H9tGYqvEeZGyRh9e0ij8huqUG+PT21rVmCqFh3LS4ADwuaI67GmBHXwoedR 9hrE4gEYrsxUybPe3WAmf5ikQtifyOodnZAcxzaqOfvZsWKjSVdiceHQx5i7P0aNXf 1micIZr1P85CUqB65mcAHzo3h4ljxM2k5Py5b6JI= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([94.134.180.254]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Madzi-1mhf9z46he-00c9rU; Wed, 04 Aug 2021 21:27:26 +0200 Date: Wed, 4 Aug 2021 21:27:24 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH] multifd: Implement yank for multifd send side Message-ID: <20210804212724.07e411d6@gecko.fritz.box> MIME-Version: 1.0 X-Provags-ID: V03:K1:y9J/XpZLWHCMmTO4IxL5C3esQ2o5TV+BgQwYefJ43XynDXxStpe truC0i1H8Qas1enTratLX5tgVt9AGQoiG+5VW9dX/7iFp1YK3jBTmez9y2/5s9AKPqfyF31 u1cXV2pyBjylgejwMDI4OwcJTkAkgHr3y+YBCY7EgbQ5OF+vEZ0k15imIPYAMSnuf6p5/nK Idl7fuSAeL3cm+K/v2jow== X-UI-Out-Filterresults: notjunk:1;V03:K0:We6Yy55Nzg8=:OucdjQHx7Celkn4B0Lct+h Km0xSk432iMBdXcRvD5DXAmUl45odpmND3oA8hq/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BGCguW2G0kOHBD5vfNRvPS+EYUvP00moTSPc3xTqzsLpMviktvT5X5VCft461 uQGSs= Received-SPF: pass client-ip=212.227.15.14; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Xiaohui , Leonardo Bras Soares Passos , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When introducing yank functionality in the migration code I forgot to cover the multifd send side. Signed-off-by: Lukas Straub Tested-by: Leonardo Bras Reviewed-by: Leonardo Bras --- @Leonardo Could you check if this fixes your issue? migration/multifd.c | 6 +++++- migration/multifd.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index 377da78f5b..5a4f158f3c 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -546,6 +546,9 @@ void multifd_save_cleanup(void) MultiFDSendParams *p = &multifd_send_state->params[i]; Error *local_err = NULL; + if (p->registered_yank) { + migration_ioc_unregister_yank(p->c); + } socket_send_channel_destroy(p->c); p->c = NULL; qemu_mutex_destroy(&p->mutex); @@ -813,7 +816,8 @@ static bool multifd_channel_connect(MultiFDSendParams *p, return false; } } else { - /* update for tls qio channel */ + migration_ioc_register_yank(ioc); + p->registered_yank = true; p->c = ioc; qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, QEMU_THREAD_JOINABLE); diff --git a/migration/multifd.h b/migration/multifd.h index 8d6751f5ed..16c4d112d1 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -85,6 +85,8 @@ typedef struct { bool running; /* should this thread finish */ bool quit; + /* is the yank function registered */ + bool registered_yank; /* thread has work to do */ int pending_job; /* array of pages to sent */