From nobody Mon Nov 25 07:44:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1717507314; cv=none; d=zohomail.com; s=zohoarc; b=mrHTJdFVuVe8ZKem2M6PXexz9vPt/hWl7El6yoT8o6siYNDaYyz54hURaTKkC4pfDF4h3+D6P7qvH3UVEIvzLketKorK0O8YLC40SkBF6TjCiE8qMsugUKa5q5U45mpBIFvxDZFENwUSsgTSCiEX8Bf9IWVLtXvr/wwGAu3imbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717507314; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JdcCFiC2mfWvpShWPR8JlwVcxBvJO+Ds9KmtwuLQ5pQ=; b=AaZQUdTnz652tcMrwi4ha33Mc0vr3VeP+1RkjPCMHz7YfmwEL0z+sYYcYnpTgvhHvpNTNS265MP5m5aSGTtp7oUS1dAIHyhL70Pzjxc7zdKMYK/7Om9SU1kDlK0qxO7Lmncr2QsLLVtyVD12QVsPOvk8FKDxMiwvAo9VcXUK3co= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717507314130771.452635559494; Tue, 4 Jun 2024 06:21:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEU5o-0001fR-M8; Tue, 04 Jun 2024 09:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEU5n-0001eq-ER for qemu-devel@nongnu.org; Tue, 04 Jun 2024 09:20:47 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEU5l-0000YV-9g for qemu-devel@nongnu.org; Tue, 04 Jun 2024 09:20:47 -0400 Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 06:20:45 -0700 Received: from sae-gw02.sh.intel.com (HELO localhost) ([10.239.45.110]) by fmviesa006.fm.intel.com with ESMTP; 04 Jun 2024 06:20:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717507246; x=1749043246; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qKBr5xnyvZqzkLheeiw0t24J8uWKU5VJBsRmV6jqV6Y=; b=Tk17WXfcU8ehjvHQzoxCJWiLc1YxHlG0i1i781WAPWthpKyf9SMD7yMp fwpEuaA6lUQ8ww8ms1E9VjzGSu5xSKsFkE0y45eVxoFXSInlz3Y/yP6T7 qKpwVKWs1X33gGvm+Nsb0qMBR6PMYNOh8eL6Zwy17D+ld5lHsqaguaEcB pfJ6eHWwBTd/oSEf3v8w9RyJPYh2x0OPmy788uFnM07cCWJ6uAIm5FKr4 vKHGJOC1/hjnLx0oIAtxmLU8e4UsECzM7CzhImuyNZRXlNt8XXW3qXAZ3 Z2u2lK8K76wVBSX1BTULWkGHlj3m9rN8aaNHOylQYA/TLNlXRlyidLr7l Q==; X-CSE-ConnectionGUID: JdVWG/ePQrCEmqeaLUUpDw== X-CSE-MsgGUID: lT9qkaI/RUyY53amECXs1w== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="24628675" X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="24628675" X-CSE-ConnectionGUID: flV193EFT7Sl8QtL9ukplA== X-CSE-MsgGUID: lTHKi1HrQ5SsEcOHF7LC2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="37246929" From: Yuan Liu To: peterx@redhat.com, farosas@suse.de, pbonzini@redhat.com, marcandre.lureau@redhat.com, berrange@redhat.com, thuth@redhat.com, philmd@linaro.org Cc: qemu-devel@nongnu.org, yuan1.liu@intel.com, nanhai.zou@intel.com, shameerali.kolothum.thodi@huawei.com Subject: [PATCH v7 4/7] migration/multifd: add qpl compression method Date: Mon, 3 Jun 2024 23:41:03 +0800 Message-ID: <20240603154106.764378-5-yuan1.liu@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240603154106.764378-1-yuan1.liu@intel.com> References: <20240603154106.764378-1-yuan1.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.11; envelope-from=yuan1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1717507315251100007 Content-Type: text/plain; charset="utf-8" add the Query Processing Library (QPL) compression method Introduce the qpl as a new multifd migration compression method, it can use In-Memory Analytics Accelerator(IAA) to accelerate compression and decompression, which can not only reduce network bandwidth requirement but also reduce host compression and decompression CPU overhead. How to enable qpl compression during migration: migrate_set_parameter multifd-compression qpl There is no qpl compression level parameter added since it only supports level one, users do not need to specify the qpl compression level. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Peter Xu --- hw/core/qdev-properties-system.c | 2 +- migration/meson.build | 1 + migration/multifd-qpl.c | 20 ++++++++++++++++++++ migration/multifd.h | 1 + qapi/migration.json | 7 ++++++- 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 migration/multifd-qpl.c diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index d79d6f4b53..6ccd7224f6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -659,7 +659,7 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { const PropertyInfo qdev_prop_multifd_compression =3D { .name =3D "MultiFDCompression", .description =3D "multifd_compression values, " - "none/zlib/zstd", + "none/zlib/zstd/qpl", .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, diff --git a/migration/meson.build b/migration/meson.build index bdc3244bce..5f146fe8a9 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -39,6 +39,7 @@ endif =20 system_ss.add(when: rdma, if_true: files('rdma.c')) system_ss.add(when: zstd, if_true: files('multifd-zstd.c')) +system_ss.add(when: qpl, if_true: files('multifd-qpl.c')) =20 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('ram.c', diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c new file mode 100644 index 0000000000..056a68a060 --- /dev/null +++ b/migration/multifd-qpl.c @@ -0,0 +1,20 @@ +/* + * Multifd qpl compression accelerator implementation + * + * Copyright (c) 2023 Intel Corporation + * + * Authors: + * Yuan Liu + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/module.h" + +static void multifd_qpl_register(void) +{ + /* noop */ +} + +migration_init(multifd_qpl_register); diff --git a/migration/multifd.h b/migration/multifd.h index c9d9b09239..5b7d9b15f8 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -40,6 +40,7 @@ MultiFDRecvData *multifd_get_recv_data(void); #define MULTIFD_FLAG_NOCOMP (0 << 1) #define MULTIFD_FLAG_ZLIB (1 << 1) #define MULTIFD_FLAG_ZSTD (2 << 1) +#define MULTIFD_FLAG_QPL (4 << 1) =20 /* This value needs to be a multiple of qemu_target_page_size() */ #define MULTIFD_PACKET_SIZE (512 * 1024) diff --git a/qapi/migration.json b/qapi/migration.json index a351fd3714..f97bc3bb93 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -554,11 +554,16 @@ # # @zstd: use zstd compression method. # +# @qpl: use qpl compression method. Query Processing Library(qpl) is based= on +# the deflate compression algorithm and use the Intel In-Memory Anal= ytics +# Accelerator(IAA) accelerated compression and decompression. (Since= 9.1) +# # Since: 5.0 ## { 'enum': 'MultiFDCompression', 'data': [ 'none', 'zlib', - { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] } + { 'name': 'zstd', 'if': 'CONFIG_ZSTD' }, + { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] } =20 ## # @MigMode: --=20 2.43.0