From patchwork Tue Jul 16 14:54:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Kotov X-Patchwork-Id: 11046211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B04B112C for ; Tue, 16 Jul 2019 14:56:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A89D2858A for ; Tue, 16 Jul 2019 14:56:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2F2E285CE; Tue, 16 Jul 2019 14:56:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A28B2858A for ; Tue, 16 Jul 2019 14:56:10 +0000 (UTC) Received: from localhost ([::1]:49783 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnOsE-0003Xd-0v for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Jul 2019 10:56:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50007) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnOrB-0007ac-Ug for qemu-devel@nongnu.org; Tue, 16 Jul 2019 10:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnOrA-0001L7-Ca for qemu-devel@nongnu.org; Tue, 16 Jul 2019 10:55:05 -0400 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]:48168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnOr9-0001Jp-Ps for qemu-devel@nongnu.org; Tue, 16 Jul 2019 10:55:04 -0400 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id DB5EF2E0A2C; Tue, 16 Jul 2019 17:54:56 +0300 (MSK) Received: from smtpcorp1j.mail.yandex.net (smtpcorp1j.mail.yandex.net [2a02:6b8:0:1619::137]) by mxbackcorp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aPqPlABj9T-stUSOoaf; Tue, 16 Jul 2019 17:54:56 +0300 Precedence: bulk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1563288896; bh=KFO5oG2Nm1dwR2QfkRer46qbSk588/2/p2CI7n5RCj0=; h=Message-Id:Date:Subject:To:From:Cc; b=tnK9X8gTaPF4vFQvPGzPi/gRbScCY14JEdO5CO/8lD50tCoxDeP6sYQIaTMvAPZ9s ODGp/TsnMmq7bn4MYYlj1wxaSXVCZSN72kWcepYmUqUQHTnslPVGMnaI3oy5/sD2ZJ GAiTe1pFF1KNbifI/YdZiLdf/tX6fDOYEK6LeBuI= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:68fa:19fe:5639:24b5]) by smtpcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id RzIFhwRP0o-stQiIRJr; Tue, 16 Jul 2019 17:54:55 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Yury Kotov To: Paolo Bonzini , Richard Henderson , Thomas Huth , Laurent Vivier , Juan Quintela , "Dr. David Alan Gilbert" , Stefan Weil Date: Tue, 16 Jul 2019 17:54:18 +0300 Message-Id: <20190716145421.17645-1-yury-kotov@yandex-team.ru> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 95.108.205.193 Subject: [Qemu-devel] [PATCH v2 0/3] High downtime with 95+ throttle pct X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, yc-core@yandex-team.ru Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, V2: * Added a test * Fixed qemu_cond_timedwait for qsp I wrote a test for migration auto converge and found out a strange thing: 1. Enable auto converge 2. Set max-bandwidth 1Gb/s 3. Set downtime-limit 1ms 4. Run standard test (just writes a byte per page) 5. Wait for converge 6. It's converged with 99% throttle percentage 7. The result downtime was about 300-600ms <<<< It's much higher than expected 1ms. I figured out that cpu_throttle_thread() function sleeps for 100ms+ for high throttle percentage (>=95%) in VCPU thread. And it sleeps even after a cpu kick. I tried to fix it by using timedwait for ms part of sleep. E.g timedwait(halt_cond, 1ms) + usleep(500). Regards, Yury Yury Kotov (3): qemu-thread: Add qemu_cond_timedwait cpus: Fix throttling during vm_stop tests/migration: Add a test for auto converge cpus.c | 27 ++++++--- include/qemu/thread.h | 18 ++++++ tests/migration-test.c | 119 +++++++++++++++++++++++++++++++++++---- util/qemu-thread-posix.c | 40 +++++++++---- util/qemu-thread-win32.c | 16 ++++++ util/qsp.c | 18 ++++++ 6 files changed, 207 insertions(+), 31 deletions(-)