From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 98E3AC7618B for ; Wed, 24 Jul 2019 08:44:22 +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 71993227BF for ; Wed, 24 Jul 2019 08:44:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71993227BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqCsn-0005Oi-8o for qemu-devel@archiver.kernel.org; Wed, 24 Jul 2019 04:44:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33947) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqCs6-0002cK-9W for qemu-devel@nongnu.org; Wed, 24 Jul 2019 04:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqCs5-0001oL-4i for qemu-devel@nongnu.org; Wed, 24 Jul 2019 04:43:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36288) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hqCs4-0001nG-Ur for qemu-devel@nongnu.org; Wed, 24 Jul 2019 04:43:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 466E78F921; Wed, 24 Jul 2019 08:43:35 +0000 (UTC) Received: from redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE46F60A9F; Wed, 24 Jul 2019 08:43:34 +0000 (UTC) From: Juan Quintela To: Ivan Ren In-Reply-To: <1561468699-9819-2-git-send-email-ivanren@tencent.com> (Ivan Ren's message of "Tue, 25 Jun 2019 21:18:17 +0800") References: <1561468699-9819-1-git-send-email-ivanren@tencent.com> <1561468699-9819-2-git-send-email-ivanren@tencent.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Date: Wed, 24 Jul 2019 10:43:32 +0200 Message-ID: <87o91j9617.fsf@trasno.org> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 24 Jul 2019 08:43:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH 1/3] migration: fix migrate_cancel leads live_migration thread endless loop 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: , Reply-To: quintela@redhat.com Cc: dgilbert@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Ivan Ren wrote: > When we 'migrate_cancel' a multifd migration, live_migration thread may > go into endless loop in multifd_send_pages functions. > > Reproduce steps: > > (qemu) migrate_set_capability multifd on > (qemu) migrate -d url > (qemu) [wait a while] > (qemu) migrate_cancel > > Then may get live_migration 100% cpu usage in following stack: > > pthread_mutex_lock > qemu_mutex_lock_impl > multifd_send_pages > multifd_queue_page > ram_save_multifd_page > ram_save_target_page > ram_save_host_page > ram_find_and_save_block > ram_find_and_save_block > ram_save_iterate > qemu_savevm_state_iterate > migration_iteration_run > migration_thread > qemu_thread_start > start_thread > clone > > Signed-off-by: Ivan Ren Reviewed-by: Juan Quintela Will sent for rc3.