All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, zhengchuan@huawei.com,
	dovmurik@linux.vnet.ibm.com, hgcoin@gmail.com,
	zhangjiachen.jaycee@bytedance.com, lvivier@redhat.com,
	peterx@redhat.com, stefanha@redhat.com, vgoyal@redhat.com,
	jinyan12@huawei.com, ann.zhuangyanying@huawei.com
Cc: quintela@redhat.com
Subject: [PULL 03/26] migration/dirtyrate: setup up query-dirtyrate framwork
Date: Fri, 25 Sep 2020 13:06:32 +0100	[thread overview]
Message-ID: <20200925120655.295142-4-dgilbert@redhat.com> (raw)
In-Reply-To: <20200925120655.295142-1-dgilbert@redhat.com>

From: Chuan Zheng <zhengchuan@huawei.com>

Add get_dirtyrate_thread() functions to setup query-dirtyrate
framework.

Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Signed-off-by: YanYing Zhuang <ann.zhuangyanying@huawei.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <1600237327-33618-2-git-send-email-zhengchuan@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/dirtyrate.c | 38 ++++++++++++++++++++++++++++++++++++++
 migration/dirtyrate.h | 28 ++++++++++++++++++++++++++++
 migration/meson.build |  2 +-
 3 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 migration/dirtyrate.c
 create mode 100644 migration/dirtyrate.h

diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
new file mode 100644
index 0000000000..bf7fd24e75
--- /dev/null
+++ b/migration/dirtyrate.c
@@ -0,0 +1,38 @@
+/*
+ * Dirtyrate implement code
+ *
+ * Copyright (c) 2020 HUAWEI TECHNOLOGIES CO.,LTD.
+ *
+ * Authors:
+ *  Chuan Zheng <zhengchuan@huawei.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "cpu.h"
+#include "qemu/config-file.h"
+#include "exec/memory.h"
+#include "exec/ramblock.h"
+#include "exec/target_page.h"
+#include "qemu/rcu_queue.h"
+#include "qapi/qapi-commands-migration.h"
+#include "migration.h"
+#include "dirtyrate.h"
+
+static void calculate_dirtyrate(struct DirtyRateConfig config)
+{
+    /* todo */
+    return;
+}
+
+void *get_dirtyrate_thread(void *arg)
+{
+    struct DirtyRateConfig config = *(struct DirtyRateConfig *)arg;
+
+    calculate_dirtyrate(config);
+
+    return NULL;
+}
diff --git a/migration/dirtyrate.h b/migration/dirtyrate.h
new file mode 100644
index 0000000000..84ab9409ac
--- /dev/null
+++ b/migration/dirtyrate.h
@@ -0,0 +1,28 @@
+/*
+ *  Dirtyrate common functions
+ *
+ *  Copyright (c) 2020 HUAWEI TECHNOLOGIES CO., LTD.
+ *
+ *  Authors:
+ *  Chuan Zheng <zhengchuan@huawei.com>
+ *
+ *  This work is licensed under the terms of the GNU GPL, version 2 or later.
+ *  See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_MIGRATION_DIRTYRATE_H
+#define QEMU_MIGRATION_DIRTYRATE_H
+
+/*
+ * Sample 512 pages per GB as default.
+ * TODO: Make it configurable.
+ */
+#define DIRTYRATE_DEFAULT_SAMPLE_PAGES            512
+
+struct DirtyRateConfig {
+    uint64_t sample_pages_per_gigabytes; /* sample pages per GB */
+    int64_t sample_period_seconds; /* time duration between two sampling */
+};
+
+void *get_dirtyrate_thread(void *arg);
+#endif
diff --git a/migration/meson.build b/migration/meson.build
index ac8ff1419f..b5b71c8060 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -37,4 +37,4 @@ softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c'))
 softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c'))
 softmmu_ss.add(when: 'CONFIG_ZSTD', if_true: [files('multifd-zstd.c'), zstd])
 
-specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('ram.c'))
+specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('dirtyrate.c', 'ram.c'))
-- 
2.26.2



  parent reply	other threads:[~2020-09-25 12:11 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 12:06 [PULL 00/26] migration and friends queue Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 01/26] migration: Properly destroy variables on incoming side Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 02/26] migration: Rework migrate_send_rp_req_pages() function Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` Dr. David Alan Gilbert (git) [this message]
2020-09-25 12:06 ` [PULL 04/26] migration/dirtyrate: add DirtyRateStatus to denote calculation status Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 05/26] migration/dirtyrate: Add RamblockDirtyInfo to store sampled page info Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 06/26] migration/dirtyrate: Add dirtyrate statistics series functions Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 07/26] migration/dirtyrate: move RAMBLOCK_FOREACH_MIGRATABLE into ram.h Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 08/26] migration/dirtyrate: Record hash results for each sampled page Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 09/26] migration/dirtyrate: Compare page hash results for recorded " Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 10/26] migration/dirtyrate: skip sampling ramblock with size below MIN_RAMBLOCK_SIZE Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 11/26] migration/dirtyrate: Implement set_sample_page_period() and is_sample_period_valid() Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 12/26] migration/dirtyrate: Implement calculate_dirtyrate() function Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 13/26] migration/dirtyrate: Implement qmp_cal_dirty_rate()/qmp_get_dirty_rate() function Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 14/26] migration/dirtyrate: Add trace_calls to make it easier to debug Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 15/26] migration: Truncate state file in xen-save-devices-state Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 16/26] migration: increase max-bandwidth to 128 MiB/s (1 Gib/s) Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 17/26] migration/tls: save hostname into MigrationState Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 18/26] migration/tls: extract migration_tls_client_create for common-use Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 19/26] migration/tls: add tls_hostname into MultiFDSendParams Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 20/26] migration/tls: extract cleanup function for common-use Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 21/26] migration/tls: add support for multifd tls-handshake Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 22/26] migration/tls: add trace points for multifd-tls Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 23/26] monitor: Use LOCK_GUARD macros Dr. David Alan Gilbert (git)
2023-02-07 13:26   ` Marc-André Lureau
2023-02-07 13:41     ` Dr. David Alan Gilbert
2023-02-07 14:06       ` Marc-André Lureau
2020-09-25 12:06 ` [PULL 24/26] virtiofsd: document cache=auto default Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 25/26] virtiofsd: Used glib "shared" thread pool Dr. David Alan Gilbert (git)
2020-09-25 12:06 ` [PULL 26/26] virtiofsd: Add -o allow_direct_io|no_allow_direct_io options Dr. David Alan Gilbert (git)
2020-09-29 21:53   ` Vivek Goyal
2020-09-30  2:14     ` [External] " Jiachen Zhang
2020-09-25 12:35 ` [PULL 00/26] migration and friends queue no-reply
2020-09-25 14:31   ` Dr. David Alan Gilbert
2020-09-25 16:22 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925120655.295142-4-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=ann.zhuangyanying@huawei.com \
    --cc=dovmurik@linux.vnet.ibm.com \
    --cc=hgcoin@gmail.com \
    --cc=jinyan12@huawei.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=vgoyal@redhat.com \
    --cc=zhangjiachen.jaycee@bytedance.com \
    --cc=zhengchuan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.