qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU


From: Hyman
Subject: Re: [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU
Date: Mon, 6 Dec 2021 23:22:08 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2



在 2021/12/6 16:39, Peter Xu 写道:
On Fri, Dec 03, 2021 at 09:39:47AM +0800, huangy81@chinatelecom.cn wrote:
+void dirtylimit_setup(int max_cpus)
+{
+    if (!kvm_enabled() || !kvm_dirty_ring_enabled()) {
+        return;
+    }
+
+    dirtylimit_calc_state_init(max_cpus);
+    dirtylimit_state_init(max_cpus);
+}

[...]

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 620a1f1..0f83ce3 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3777,5 +3777,6 @@ void qemu_init(int argc, char **argv, char **envp)
      qemu_init_displays();
      accel_setup_post(current_machine);
      os_setup_post();
+    dirtylimit_setup(current_machine->smp.max_cpus);
      resume_mux_open();

Can we do the init only when someone enables it?  We could also do proper
free() for the structs when it's globally turned off.
Yes, i'll try this next version




reply via email to

[Prev in Thread] Current Thread [Next in Thread]