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: 10446173 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 4D705603D7 for ; Mon, 4 Jun 2018 09:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DDA428BC6 for ; Mon, 4 Jun 2018 09:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3274B28BD0; Mon, 4 Jun 2018 09:56:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0BD328BC6 for ; Mon, 4 Jun 2018 09:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752310AbeFDJ4Q (ORCPT ); Mon, 4 Jun 2018 05:56:16 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:38028 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbeFDJ4N (ORCPT ); Mon, 4 Jun 2018 05:56:13 -0400 Received: by mail-pg0-f48.google.com with SMTP id c9-v6so11429991pgf.5 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=N+qbmDZPvl+g4G4vI33OkKOXAqdbtNAvF1+ax1lKB6ZXB+ZdAXnO3oizAgwI/vi9D+ wNlGxZSfJ/9J7K2sSARFKNn9yj4HeSb2MRTslR9CE04y5FStR+esBFB6tmSpMCNWUKub EC7Wz3Q6Y4DkaiNcHvHNQU8Brum2/qQnCOpNBPTLPIJ5xW0xIvBsP2jwNtRSziv1nndv 8Zi9tYsppFgLHpSps4+zVGHMcN/7l0jqL3oVouT58fa74xelKFYLgUcTNolPDUdPoDtF 6rsKIEcBZ5RUOLK2fT5AOpAJStamw6RedL0kAiB2jCzUmdhlSd35dPxwRdoQVvMy2dhW arSg== X-Gm-Message-State: ALKqPwcqppVAqlMfhxQhvSrcG1UC1X57dnicOdB812qeG3fouvX8J0fu y2kbneByDvhCsX3PsfBgtl0= 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 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, dgilbert@redhat.com, peterx@redhat.com, jiang.biao2@zte.com.cn, wei.w.wang@intel.com, Xiao Guangrong Subject: [PATCH 03/12] migration: fix counting xbzrle cache_miss_rate 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 */