From patchwork Tue Aug 7 09:11:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 10558433 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 8718F13B4 for ; Tue, 7 Aug 2018 09:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 771F426538 for ; Tue, 7 Aug 2018 09:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B1F429690; Tue, 7 Aug 2018 09:13:55 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AF3726538 for ; Tue, 7 Aug 2018 09:13:54 +0000 (UTC) Received: from localhost ([::1]:38007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmy3t-00035a-RD for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Aug 2018 05:13:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmy2h-00035E-GX for qemu-devel@nongnu.org; Tue, 07 Aug 2018 05:12:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmy2e-00052g-6O for qemu-devel@nongnu.org; Tue, 07 Aug 2018 05:12:39 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:39729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmy2d-00052U-VM for qemu-devel@nongnu.org; Tue, 07 Aug 2018 05:12:36 -0400 Received: by mail-pf1-x431.google.com with SMTP id j8-v6so8281185pff.6 for ; Tue, 07 Aug 2018 02:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BrqzJZWb8/hX4IbhOubAryrfW1AwYJC1UWXowWqx73w=; b=JQVaWj+VDGupxKg4kwdgRzrqSGJ2LbV7gO/kCJ9xRQNMX7WM6KOkq1zmqTkafU9wYv ySdBan0u4kmsdCuczmv2M3A1xTYxRxXZrtnF7duhNUF1S9PCzFav0mqEdnBzHYG7yGx9 i87BUMEo4tWJdvwGqgR/WIZ1NeXkXoS8a+c2LRD+7AhbNT1ZMqRtm5eQBYRHt6MXVerc BrGI85VSeTLzayaITZAYHEFRt9DA8JvIBrXeipWktRZX8kWSY91UAdRetTPCj18EKLdG M9aBl31+xl4/kw+9c+HoadfB1SVlMMlTDruTixhROlKaLuFxjwm3aIA9mVHIsCxg9mgQ C/HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BrqzJZWb8/hX4IbhOubAryrfW1AwYJC1UWXowWqx73w=; b=Tq1TNU7R9SHlIxV5klSANlMPmrUbUQAuFTf/WIbdioU5ZSfR0P24lcQX8u4vSSejfT oCwoMdF1uM0/VqhW04HnKhQ+eW2+o4m60w++WMtr1r9T8lz8o1uI4MP0yu85uN4HYerV hn1yAT/+rnTe05cveqCiSJseUkao211m5pAZI7M33gThGfpLDRIIypTeEh9hgkYLP/9i 8mq/o16OLUPfoED6+chUnMMRiVmKdQwuA4JoDsXhfORnoAg0QXIVZzCvPjSwgj9mEOwg lhLi7u8s6NIYneLe5abyrNMndtZUqPlh7x9GDfm85Tab5BqRlyWlqsclq7oCLHC+8xcn aDHw== X-Gm-Message-State: AOUpUlEHf6PdC8QrzTbByV5qF2EKoKTSKxRPI30chSTKu1pEanZvROfN dFH30RevSOglf4FKfrIKnUM= X-Google-Smtp-Source: AAOMgpfnf3FxrdeZo2gwmx+CLHBHYV4Be29xGpcLWmFPOI3GO191m5RTsYZ5Ne19iNC8ngrYohitUA== X-Received: by 2002:a65:4344:: with SMTP id k4-v6mr4083439pgq.409.1533633154780; Tue, 07 Aug 2018 02:12:34 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.37]) by smtp.gmail.com with ESMTPSA id z4-v6sm2159645pfl.11.2018.08.07.02.12.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Aug 2018 02:12:34 -0700 (PDT) From: guangrong.xiao@gmail.com X-Google-Original-From: xiaoguangrong@tencent.com To: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com Date: Tue, 7 Aug 2018 17:11:59 +0800 Message-Id: <20180807091209.13531-1-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.14.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::431 Subject: [Qemu-devel] [PATCH v3 00/10] migration: compression optimization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Xiao Guangrong , qemu-devel@nongnu.org, peterx@redhat.com, dgilbert@redhat.com, wei.w.wang@intel.com, jiang.biao2@zte.com.cn Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Xiao Guangrong Changelog in v3: Thanks to Peter's comments, the changes in this version are: 1) make compress-wait-thread be true on default to keep current behavior 2) save the compressed-size instead of reduced size and fix calculating compression ratio 3) fix calculating xbzrle_counters.cache_miss_rate and compression_counters.busy_rate Xiao Guangrong (10): migration: do not wait for free thread migration: fix counting normal page for compression migration: introduce save_zero_page_to_file migration: drop the return value of do_compress_ram_page migration: move handle of zero page to the thread migration: hold the lock only if it is really needed migration: do not flush_compressed_data at the end of each iteration migration: handle the error condition properly migration: fix calculating xbzrle_counters.cache_miss_rate migration: show the statistics of compression hmp.c | 21 ++++ include/qemu/queue.h | 1 + migration/migration.c | 33 ++++++ migration/migration.h | 1 + migration/ram.c | 283 +++++++++++++++++++++++++++++++++++++------------- migration/ram.h | 1 + qapi/migration.json | 49 +++++++-- 7 files changed, 308 insertions(+), 81 deletions(-)