From patchwork Tue Mar 13 07:57:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 885009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U/UBO+Hi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 400nKm6PNBz9sSZ for ; Tue, 13 Mar 2018 18:58:35 +1100 (AEDT) Received: from localhost ([::1]:37433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evepM-0002rF-OU for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2018 03:58:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eveol-0002r3-LN for qemu-devel@nongnu.org; Tue, 13 Mar 2018 03:57:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eveoi-0007L2-Ko for qemu-devel@nongnu.org; Tue, 13 Mar 2018 03:57:55 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:41357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eveoi-0007K5-EG for qemu-devel@nongnu.org; Tue, 13 Mar 2018 03:57:52 -0400 Received: by mail-pl0-x241.google.com with SMTP id d9-v6so10875862plo.8 for ; Tue, 13 Mar 2018 00:57:52 -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=gfwKSOzsfTfwl092ZUCJViu7h9UDgcYVd9LBY4sQn4g=; b=U/UBO+HicFhFQ+g0QA2g1EFR/m5c1s07uljCqIQGxvAsX7na4j001ys4+C7c6XrdBC +FsB/vU0WhDVYQs4m5CRTAv+GUfwVYpQaoyBtrpk80nrKm4K5SkHPWLI3+Vsc+ZCk+Nw dCODxXaUVAX7cH/l3j00C1OSM/UvLth9NDA74Uf2bBzhJbQ4GSPiLoJMA66eZ7PGr0Td eiz37+UyJnaXf4nF1XKF0u54igRbPUSyMV1JSag6xxqNY0NCtRTC/EBjBoaVhi88tXuz M9EaylYHtD78rHpYN3apGcvEKADAVpt/isU/sa3uufzm6YyWSPAiL0oDazO6oGPyVlk1 o0sQ== 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=gfwKSOzsfTfwl092ZUCJViu7h9UDgcYVd9LBY4sQn4g=; b=JvCKCzb4hbwLv1jeti1DNyJeHPxNuepSl9ijKv7aZfIyscWQFQpp+XsQRW6NPMwThe Inqfii15s6saZlCGLhBkzaWNGDQTpk74ue/NFz8qH6VoohJAsnspezTpSd2KkPY+URBE JfCEhzwkh/mKA5B+Zo9Vk5DLvUScygg39GJ7IeyziOPeQaf0+vj2U1LzLLRSLJLs0Ek9 I1i2fbAyrxLXP6d8vXGKA31r6MOUpNMnWweyuLwLAofpokZdCNBtS2SCb3zg9Oqgmoew nqxob+7phCQYsqX6JScxvA+beT8Qnd79vnJtXpTig0qeYmsJPKKGBodalAWGQ+73Fjq6 fGRg== X-Gm-Message-State: AElRT7FoA4mAcxZ1zHoUMlQNrp86WejpBuYdncfUtbkS88w9yQAusyHQ 8YPhYgtanlMuK2NeiHBU0OcEpw== X-Google-Smtp-Source: AG47ELu+E1P9uE59FYPFappfWbq9lLb7ZZFKvfhfqbXIYMmO044AxkP83kpGDHR7lvaBXUyYcinyzQ== X-Received: by 2002:a17:902:20eb:: with SMTP id v40-v6mr5346031plg.277.1520927871249; Tue, 13 Mar 2018 00:57:51 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.35]) by smtp.gmail.com with ESMTPSA id x4sm16756537pgv.72.2018.03.13.00.57.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Mar 2018 00:57:50 -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, 13 Mar 2018 15:57:31 +0800 Message-Id: <20180313075739.11194-1-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH 0/8] migration: improve and cleanup compression 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: Xiao Guangrong , qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Xiao Guangrong This is the first part of our work to improve compression to make it be more useful in the production. The first patch resolves the problem that the migration thread spends too much CPU resource to compression memory if it jumps to a new block that causes the network is used very deficient. The second patch fixes the performance issue that too many VM-exits happen during live migration if compression is being used, it is caused by huge memory returned to kernel frequently as the memory is allocated and freed for every signal call to compress2() The remaining patches clean the code up dramatically Xiao Guangrong (8): migration: stop compressing page in migration thread migration: stop allocating and freeing memory frequently migration: support to detect compression and decompression errors migration: introduce control_save_page() migration: move calling control_save_page to the common place migration: move calling save_zero_page to the common place migration: introduce save_normal_page() migration: remove ram_save_compressed_page() migration/qemu-file.c | 38 ++++- migration/qemu-file.h | 6 +- migration/ram.c | 430 +++++++++++++++++++++++++++++--------------------- 3 files changed, 290 insertions(+), 184 deletions(-)