All of lore.kernel.org
 help / color / mirror / Atom feed
From: huangy81@chinatelecom.cn
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Hyman Huang <huangy81@chinatelecom.cn>
Subject: [PATCH v23 5/8] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function
Date: Thu, 19 May 2022 11:25:16 +0800	[thread overview]
Message-ID: <c99e7851c2e2b99312cfbabe4d1f6379a3da8a44.1652929817.git.huangy81@chinatelecom.cn> (raw)
In-Reply-To: <cover.1652929816.git.huangy81@chinatelecom.cn>
In-Reply-To: <cover.1652929816.git.huangy81@chinatelecom.cn>

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

Introduce kvm_dirty_ring_size util function to help calculate
dirty ring ful time.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Acked-by: Peter Xu <peterx@redhat.com>
---
 accel/kvm/kvm-all.c    | 5 +++++
 accel/stubs/kvm-stub.c | 6 ++++++
 include/sysemu/kvm.h   | 2 ++
 3 files changed, 13 insertions(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index b13cd27..0c6846b 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2313,6 +2313,11 @@ bool kvm_dirty_ring_enabled(void)
     return kvm_state->kvm_dirty_ring_size ? true : false;
 }
 
+uint32_t kvm_dirty_ring_size(void)
+{
+    return kvm_state->kvm_dirty_ring_size;
+}
+
 static int kvm_init(MachineState *ms)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index 3345882..c5aafaa 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -148,3 +148,9 @@ bool kvm_dirty_ring_enabled(void)
 {
     return false;
 }
+
+uint32_t kvm_dirty_ring_size(void)
+{
+    return 0;
+}
+#endif
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index a783c78..efd6dee 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -582,4 +582,6 @@ bool kvm_cpu_check_are_resettable(void);
 bool kvm_arch_cpu_check_are_resettable(void);
 
 bool kvm_dirty_ring_enabled(void);
+
+uint32_t kvm_dirty_ring_size(void);
 #endif
-- 
1.8.3.1



  parent reply	other threads:[~2022-05-19  3:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  3:25 [PATCH v23 0/8] support dirty restraint on vCPU huangy81
2022-05-19  3:25 ` [PATCH v23 1/8] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping huangy81
2022-05-19  3:25 ` [PATCH v23 2/8] cpus: Introduce cpu_list_generation_id huangy81
2022-05-19  3:25 ` [PATCH v23 3/8] migration/dirtyrate: Refactor dirty page rate calculation huangy81
2022-05-19  3:25 ` [PATCH v23 4/8] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically huangy81
2022-05-19  3:25 ` huangy81 [this message]
2022-05-19  3:25 ` [PATCH v23 6/8] softmmu/dirtylimit: Implement virtual CPU throttle huangy81
2022-05-19  3:25 ` [PATCH v23 7/8] softmmu/dirtylimit: Implement dirty page rate limit huangy81
2022-05-19  3:25 ` [PATCH v23 8/8] tests: Add dirty page rate limit test huangy81
2022-05-19  3:28 ` [PATCH v23 0/8] support dirty restraint on vCPU Hyman Huang

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=c99e7851c2e2b99312cfbabe4d1f6379a3da8a44.1652929817.git.huangy81@chinatelecom.cn \
    --to=huangy81@chinatelecom.cn \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@redhat.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.