From: Eric Blake <eblake@redhat.com>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: ChenLiang <chenliang88@huawei.com>,
owasserm@redhat.com, pbonzini@redhat.com,
weidong.huang@huawei.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 03/10] XBZRLE: optimize XBZRLE to decrease the cache missing
Date: Tue, 11 Mar 2014 14:52:50 -0600 [thread overview]
Message-ID: <531F77A2.80502@redhat.com> (raw)
In-Reply-To: <1394542415-5152-4-git-send-email-arei.gonglei@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2763 bytes --]
On 03/11/2014 06:53 AM, arei.gonglei@huawei.com wrote:
> From: ChenLiang <chenliang88@huawei.com>
>
> Avoid the hot pages being replaced by others to remarkable decrease cache
s/the hot/hot/
s/remarkable/remarkably/
> missing. The counter of updating dirty bitmap is used to indicate the cached
s/missing/misses/
> page age.
Please give more rationale - when claiming that something gave a speed
improvement, it helps to back up that claim with the sample program you
ran in the guest along with before and after numbers to back up your
point. A "remarkable decrease" is subjective, but pre- and post-patch
numbers is objective.
This may mean rebasing your series to re-order patches, and FIRST export
the counters that you then use to justify this patch (the current order
of applying the optimization, and only THEN exposing the numbers through
QMP, makes it harder to prove that this patch helped).
>
> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> arch_init.c | 8 +++++---
> include/migration/page_cache.h | 10 +++++++---
> page_cache.c | 23 +++++++++++++++++++----
> 3 files changed, 31 insertions(+), 10 deletions(-)
>
> acct_info.xbzrle_cache_miss++;
> if (!last_stage) {
> - if (cache_insert(XBZRLE.cache, current_addr, *current_data) == -1) {
> + if (cache_insert(XBZRLE.cache, current_addr, *current_data,
> + get_bitmap_sync_cnt()) == -1) {
Indentation - I'd write:
if (cache_insert(XBZRLE.cache, current_addr, *current_data,
get_bitmap_sync_cnt()) == -1) {
This patch needs to be rebased once you fix 2/10 to just directly use
the variable instead of wrapping it inside pointless static inline
accessor functions.
> @@ -161,6 +171,11 @@ int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata)
> /* actual update of entry */
> it = cache_get_by_addr(cache, addr);
>
> + if ((it->it_data != NULL) && (it->it_age +
> + CACHED_PAGE_LIFETIME > current_age)) {
Unnecessary (), and odd choice of line break location coupled with poor
indentation. It fits fine on one 80-column line (hmm, my email may wrap
because I write email in fewer columns than 80):
if (it->it_data && it->it_age + CACHED_PAGE_LIFETIME > current_age) {
and if you MUST break lines, breaking on the lower-priority operators
makes it easier to read the grouping:
if (it->it_data &&
it->it_age + CACHED_PAGE_LIFETIME > current_age) {
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-03-11 20:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 12:53 [Qemu-devel] [PATCH 00/10] migration: Optimization the xbzrle and fix two corruption issues arei.gonglei
2014-03-11 12:53 ` [Qemu-devel] [PATCH 01/10] XBZRLE: Fix one XBZRLE " arei.gonglei
2014-03-11 20:26 ` Juan Quintela
2014-03-11 12:53 ` [Qemu-devel] [PATCH 02/10] migration: Add counters of updating the dirty bitmap arei.gonglei
2014-03-11 13:09 ` Eric Blake
2014-03-11 13:34 ` Gonglei (Arei)
2014-03-11 20:28 ` Juan Quintela
2014-03-11 12:53 ` [Qemu-devel] [PATCH 03/10] XBZRLE: optimize XBZRLE to decrease the cache missing arei.gonglei
2014-03-11 20:34 ` Juan Quintela
2014-03-18 12:20 ` Gonglei (Arei)
2014-03-11 20:52 ` Eric Blake [this message]
2014-03-11 12:53 ` [Qemu-devel] [PATCH 04/10] XBZRLE: rebuild the cache_is_cached function arei.gonglei
2014-03-11 13:11 ` Eric Blake
2014-03-11 20:37 ` Juan Quintela
2014-03-11 12:53 ` [Qemu-devel] [PATCH 05/10] migration: Fix the migrate auto converge process arei.gonglei
2014-03-11 20:48 ` Juan Quintela
2014-03-11 20:55 ` Eric Blake
2014-03-11 22:56 ` Chegu Vinod
2014-03-18 12:23 ` Gonglei (Arei)
2014-03-11 12:53 ` [Qemu-devel] [PATCH 06/10] migraion: optimiztion xbzrle by reducing data copy arei.gonglei
2014-03-11 20:56 ` Juan Quintela
2014-03-11 20:56 ` Juan Quintela
2014-03-11 20:58 ` Eric Blake
2014-03-11 12:53 ` [Qemu-devel] [PATCH 07/10] migraion: clear the death code arei.gonglei
2014-03-11 20:58 ` Juan Quintela
2014-03-11 20:59 ` Eric Blake
2014-03-11 12:53 ` [Qemu-devel] [PATCH 08/10] migration: s/uint64_t/int64_t the definitions of it_age arei.gonglei
2014-03-11 21:02 ` Eric Blake
2014-03-11 21:08 ` Juan Quintela
2014-03-11 12:53 ` [Qemu-devel] [PATCH 09/10] migration: expose the bitmap_sync_cnt to the end user arei.gonglei
2014-03-11 13:22 ` Eric Blake
2014-03-11 21:10 ` Juan Quintela
2014-03-11 12:53 ` [Qemu-devel] [PATCH 10/10] XBZRLE: update the doc of XBZRLE arei.gonglei
2014-03-11 21:09 ` Juan Quintela
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=531F77A2.80502@redhat.com \
--to=eblake@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=chenliang88@huawei.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=weidong.huang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).