From patchwork Mon Jun 4 09:55:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 10446195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 205BC60284 for ; Mon, 4 Jun 2018 09:59:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1224F28BC6 for ; Mon, 4 Jun 2018 09:59:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 061C328BD0; Mon, 4 Jun 2018 09:59:43 +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 B74A428BC6 for ; Mon, 4 Jun 2018 09:59:42 +0000 (UTC) Received: from localhost ([::1]:38619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPmH7-0001HT-Vo for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Jun 2018 05:59:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPmDm-0007S3-N5 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 05:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPmDm-000180-2x for qemu-devel@nongnu.org; Mon, 04 Jun 2018 05:56:14 -0400 Received: from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]:39554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPmDl-00017a-Su for qemu-devel@nongnu.org; Mon, 04 Jun 2018 05:56:14 -0400 Received: by mail-pg0-x22e.google.com with SMTP id w12-v6so13037391pgc.6 for ; Mon, 04 Jun 2018 02:56:13 -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:in-reply-to:references; bh=GTtfNbytUKqqoHpXl/5SQkmcW73uJZck6kFxWCHAV8A=; b=jS5zpSYeV5+rP12XO+cP0TVtfPq5nsXoJ8bSlzhj5R13zWGYnsUNiYTTMPD+cz9fSC rgn1L2gYyCjQJ2LxmQXd7Nk9zVkznlCFhuVI6laRFw4VIUOtqTOqkUtAoVpr+bNzAjnK 4FwXAlJWHuVpX73LKOjJg9F4ibbTJRvWAomD4qIOpbW2B6q3V2lUXAFZ3dphMwLRQ/Le YeRjj0HMChlNMnRbw2oPPf3yBPsdRX4tBSxI97XEZNLZ3iHmZXBorME/x5mnICml6bbA BYgaAKyxE2ci3z2gtaOQGauV1mlIAiUyxP6Le6/PkhbGdO8bJDJN9Fw/ToKGe+yONGrG OR6A== 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:in-reply-to :references; bh=GTtfNbytUKqqoHpXl/5SQkmcW73uJZck6kFxWCHAV8A=; b=P6zi8iz9G0WBoPz83QD0hPkmD9OKxOx7nDAC44WP/eYbn7UorbbVfQuYH11EXsl9Kw bjN2JajKn7Zqq3wSiYXYByYex+hTgy6rVhnhIYu6/G+SN1m4EyJbpcs+ZKw/+X1T2+qM vlcx8lc/fsWYaYG7ZXgIkDIUKShWxZFteHubPSdz2lp3eSXGDwZSsZRUPXsyU1MQWOIC lhgsaVaSIrtVvR8uyLEyC7Q/jSvItVhOb59h/JDTHyy70uewhPyVYUw5T5wKs3pGV/pb xkvtCUkeZFaAtYUYpZboyeY10jAKJ2qumuTNmumIMJQDnElzxf/tWlzjfnDdxn2mdEzC igkQ== X-Gm-Message-State: ALKqPweMUtvNgSKIZebdyCg+DfPRsztB+7znm61EYh4nr3kQvBiCUbW/ 4faFVfUyxgEHMzIGV2ITJkP1KA== X-Google-Smtp-Source: ADUXVKK4h966uNi06yiGHh+g7OT5fLKRfRD0i5FAo5HRsDBd9u412g39/KYqXjirTZLkrQ1C+8SH/g== X-Received: by 2002:a63:2bc4:: with SMTP id r187-v6mr16651146pgr.231.1528106173019; Mon, 04 Jun 2018 02:56:13 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.35]) by smtp.gmail.com with ESMTPSA id h130-v6sm124502105pfc.98.2018.06.04.02.56.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 02:56:12 -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: Mon, 4 Jun 2018 17:55:11 +0800 Message-Id: <20180604095520.8563-4-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180604095520.8563-1-xiaoguangrong@tencent.com> References: <20180604095520.8563-1-xiaoguangrong@tencent.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22e Subject: [Qemu-devel] [PATCH 03/12] migration: fix counting xbzrle cache_miss_rate 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 Sync up xbzrle_cache_miss_prev only after migration iteration goes forward Signed-off-by: Xiao Guangrong Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index dbf24d8c87..dd1283dd45 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1189,9 +1189,9 @@ static void migration_bitmap_sync(RAMState *rs) (double)(xbzrle_counters.cache_miss - rs->xbzrle_cache_miss_prev) / (rs->iterations - rs->iterations_prev); + rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss; } rs->iterations_prev = rs->iterations; - rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss; } /* reset period counters */