All of lore.kernel.org
 help / color / mirror / Atom feed
From: wucy11@chinatelecom.cn
To: qemu-devel@nongnu.org
Cc: baiyw2@chinatelecom.cn, yuanmh12@chinatelecom.cn,
	tugy@chinatelecom.cn, "David Hildenbrand" <david@redhat.com>,
	huangy81@chinatelecom.cn, "Juan Quintela" <quintela@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	yubin1@chinatelecom.cn, dengpc12@chinatelecom.cn,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	wucy11@chinatelecom.cn
Subject: [PATCH v1 1/5] kvm, memory: Optimize dirty page collection for dirty ring
Date: Wed, 23 Mar 2022 11:18:34 +0800	[thread overview]
Message-ID: <1c2c18ab43ec43959c3464d216e6a3144b802a53.1648002360.git.wucy11@chinatelecom.cn> (raw)
In-Reply-To: <cover.1648002359.git.wucy11@chinatelecom.cn>
In-Reply-To: <cover.1648002359.git.wucy11@chinatelecom.cn>

From: Chongyun Wu <wucy11@chinatelecom.cn>

When log_sync_global of dirty ring is called, it will collect
dirty pages on all cpus, including all dirty pages on memslot,
so when memory_region_sync_dirty_bitmap collects dirty pages
from KVM, this interface needs to be called once, instead of
traversing every dirty page. Each memslot is called once,
which is meaningless and time-consuming. So only need to call
log_sync_global once in memory_region_sync_dirty_bitmap.

Signed-off-by: Chongyun Wu <wucy11@chinatelecom.cn>
---
 softmmu/memory.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 8060c6d..46c3ff9 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -2184,6 +2184,12 @@ static void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
              */
             listener->log_sync_global(listener);
             trace_memory_region_sync_dirty(mr ? mr->name : "(all)", listener->name, 1);
+            /*
+             * The log_sync_global of the dirty ring will collect the dirty
+             * pages of all memslots at one time, so there is no need to
+             * call log_sync_global once when traversing each memslot.
+             */
+            break;
         }
     }
 }
-- 
1.8.3.1



  reply	other threads:[~2022-03-23  3:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  3:18 [PATCH v1 0/5] Dirty ring and auto converge optimization wucy11
2022-03-23  3:18 ` wucy11 [this message]
2022-03-23  4:59   ` [PATCH v1 1/5] kvm,memory: Optimize dirty page collection for dirty ring Hyman Huang
2022-03-23 11:06     ` Chongyun Wu
2022-03-23  3:18 ` [PATCH v1 2/5] kvm: Dynamically adjust the rate of dirty ring reaper thread wucy11
2022-03-23  3:18 ` [PATCH v1 3/5] kvm: Dirty ring autoconverge optmization for kvm_cpu_synchronize_kick_all wucy11
2022-03-23  3:18 ` [PATCH v1 4/5] kvm: Introduce a dirty rate calculation method based on dirty ring wucy11
2022-03-23  3:18 ` [PATCH v1 5/5] migration: Calculate the appropriate throttle for autoconverge wucy11

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=1c2c18ab43ec43959c3464d216e6a3144b802a53.1648002360.git.wucy11@chinatelecom.cn \
    --to=wucy11@chinatelecom.cn \
    --cc=baiyw2@chinatelecom.cn \
    --cc=david@redhat.com \
    --cc=dengpc12@chinatelecom.cn \
    --cc=dgilbert@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=huangy81@chinatelecom.cn \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    --cc=tugy@chinatelecom.cn \
    --cc=yuanmh12@chinatelecom.cn \
    --cc=yubin1@chinatelecom.cn \
    /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.