From patchwork Thu Sep 6 07:01:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 966823 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=208.118.235.17; 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="ka0+MefJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 425WlX2Z6pz9sDb for ; Thu, 6 Sep 2018 17:04:24 +1000 (AEST) Received: from localhost ([::1]:59866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxoL0-0004dc-9s for incoming@patchwork.ozlabs.org; Thu, 06 Sep 2018 03:04:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxoI8-0001R8-Uk for qemu-devel@nongnu.org; Thu, 06 Sep 2018 03:01:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxoI8-0008Fh-4V for qemu-devel@nongnu.org; Thu, 06 Sep 2018 03:01:24 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:46850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxoI7-0008EE-F4 for qemu-devel@nongnu.org; Thu, 06 Sep 2018 03:01:24 -0400 Received: by mail-pl1-x62a.google.com with SMTP id t19-v6so4509586ply.13 for ; Thu, 06 Sep 2018 00:01:23 -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=x/yvF6rLcefKp4F7fvRvQvJ/7u8JYj73jUiGjQmP4Es=; b=ka0+MefJgOuByr+8xAauEiWM+Y10aRNyGKhOpj01m6CrjLtqlBfd+oMCv0/SxFBVkS wAtCAznapZi8qQKYc+2NkbczDdPUNdNy+aFYWkeozftaUzKfGdMGOlDORePbbXD25qnG Zzr1X9OAA2q8xJPJ2HQsODxO75L/W9rHGY1n6qj9HK00PA5ln316pinsGfMUqV0ayXAx AJdVLzNm8u3y+/vy8V61HIiBCVV4f2IP8nfVrB1ghoIdoQsR9EE7ecF/3ZQ2kzwlTH2f VY5rqFh2Be7Ug3YBJ5+/RTd0dWaw0qth3hn/u29Bhvfsc8XyCXhHxTIGdmFtd7Y18r2c inDA== 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=x/yvF6rLcefKp4F7fvRvQvJ/7u8JYj73jUiGjQmP4Es=; b=YKx8vnLH6B356B9HJzMPU2cgXYcYaDlCPiltQx2vFiVuVT3oWzSCyGtl3Ebop3fdUE kk+f7PHm5Xm0TWGXuQ19/RJm4Oi9qclCoi/NOtmBdKnh/VBljow2gtjLOPwld8mUXBsZ LSsluvPY63/XBVniLCW0nGi+2g+0j7iKbZ2i0NQUBezdY95pwnteJETtexT49luO3eIr zYPITCsFBjr9eG0QvSqKV/Ho9p8rMiejlXKVXCMkhhr+A0Mlu/3BuY4zoARKK4TCLUQr oDKCfACF+T7Lm1LiOWZTFewrXE2hGP3zNusDr8TpyfooSP/R+5WnUbRJaXCow22QvUec Ka1g== X-Gm-Message-State: APzg51B7wufA9fAbrQsLzoxQwvXL7loNAsQLtbhADMmSPiqmCQozoE0i x19kOz9YdLrHBKHkSbqxksL07xWT X-Google-Smtp-Source: ANB0VdbQT7TO6eZ8x2+rchvv5LvbDSEl3Ypx00Jpw6oGROe0MNoJDhbAj3mXFYqnZ4iMlMDoOMHdGw== X-Received: by 2002:a17:902:33c2:: with SMTP id b60-v6mr1323576plc.11.1536217282741; Thu, 06 Sep 2018 00:01:22 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.37]) by smtp.gmail.com with ESMTPSA id u195-v6sm7697017pgb.21.2018.09.06.00.01.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Sep 2018 00:01:22 -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: Thu, 6 Sep 2018 15:01:01 +0800 Message-Id: <20180906070101.27280-4-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180906070101.27280-1-xiaoguangrong@tencent.com> References: <20180906070101.27280-1-xiaoguangrong@tencent.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62a Subject: [Qemu-devel] [PATCH v6 3/3] migration: use save_page_use_compression in flush_compressed_data 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, quintela@redhat.com, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Xiao Guangrong It avoids to touch compression locks if xbzrle and compression are both enabled Signed-off-by: Xiao Guangrong Reviewed-by: Juan Quintela --- migration/ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 65a563993d..747dd9208b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1932,11 +1932,13 @@ update_compress_thread_counts(const CompressParam *param, int bytes_xmit) compression_counters.pages++; } +static bool save_page_use_compression(RAMState *rs); + static void flush_compressed_data(RAMState *rs) { int idx, len, thread_count; - if (!migrate_use_compression()) { + if (!save_page_use_compression(rs)) { return; } thread_count = migrate_compress_threads();