qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC v2 0/4] block/qapi: refactor and optimize the qmp_query_blockstats()
@ 2016-12-19  8:51 Dou Liyang
  2016-12-19  8:51 ` [Qemu-devel] [PATCH RFC v2 1/4] block: refactor bdrv_next_node for readability Dou Liyang
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Dou Liyang @ 2016-12-19  8:51 UTC (permalink / raw)
  To: stefanha, kwolf, armbru, mreitz, eblake, famz, danpb
  Cc: qemu-devel, izumi.taku, caoj.fnst, fanc.fnst, douly.fnst

These patches aim to refactor the qmp_query_blockstats() and
improve the performance by reducing the running time of it.

qmp_query_blockstats() is used to monitor the blockstats, it
querys all the graph_bdrv_states or monitor_block_backends.

There are the two jobs:

1 For the performance:

1.1 the time it takes(ns) in each time:
the disk numbers     | 10    | 500
-------------------------------------
before these patches | 19429 | 667722 
after these patches  | 17516 | 557044

1.2 the I/O performance is degraded(%) during the monitor:

the disk numbers     | 10    | 500
-------------------------------------
before these patches | 1.3   | 14.2
after these patches  | 0.8   | 9.1

used the dd command likes this to test: 
dd if=date_1.dat of=date_2.dat conv=fsync oflag=direct bs=1k count=100k.

2 refactor qmp_query_blockstats():

From:

+--------------+      +---------------------+
 | 1            |      | 4.                  |
 |next_query_bds|      |bdrv_query_bds_stats +---+
 |              |      |                     |   |
 +--------^-----+      +-------------^-------+   |
          |                          |           |
+---------+----------+      +--------+-------+   |
| 0.                 |      | 2.             |   |
|qmp_query_blockstats+------>bdrv_query_stats<----
|                    |      |                |
+--------------------+      +--------+-------+
                                     |
                       +-------------v-------+
                       | 3.                  |
                       |bdrv_query_blk_stats |
                       |                     |
                       +---------------------+

To:

                                    +--------------+
                                    |              |
                           +--------v-----------+  |
                       +--->  3.                |  |
+-------------------+  |   |bdrv_query_bds_stats+--+
| 1.                +--+   |                    |
|                   +      +--------------------+
|qmp_query_blockstats--+
|                   |  |
+-------------------+  |   +--------------------+
                       |   | 2.                 |
                       +--->                    |
                           |bdrv_query_blk_stats|
                           |                    |
                           +--------------------+


Dou Liyang (4):
  block: refactor the bdrv_next_node and add some comments
  block/qapi: reduce the coupling between the bdrv_query_stats and
    bdrv_query_bds_stats
  block/qapi: acquire a reference instead of a lock during querying
    blockstats
  block/qapi: optimize the query function of the blockstats

 block.c      | 16 ++++++++---
 block/qapi.c | 92 +++++++++++++++++++++++++-----------------------------------
 2 files changed, 50 insertions(+), 58 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-12-22 10:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-19  8:51 [Qemu-devel] [PATCH RFC v2 0/4] block/qapi: refactor and optimize the qmp_query_blockstats() Dou Liyang
2016-12-19  8:51 ` [Qemu-devel] [PATCH RFC v2 1/4] block: refactor bdrv_next_node for readability Dou Liyang
2016-12-19 14:19   ` Stefan Hajnoczi
2016-12-19  8:51 ` [Qemu-devel] [PATCH RFC v2 2/4] block/qapi: reduce the coupling between the bdrv_query_stats and bdrv_query_bds_stats Dou Liyang
2016-12-19  8:51 ` [Qemu-devel] [PATCH RFC v2 3/4] block/qapi: acquire a reference instead of a lock during querying blockstats Dou Liyang
2016-12-19 14:34   ` Stefan Hajnoczi
2016-12-19  8:51 ` [Qemu-devel] [PATCH RFC v2 4/4] block/qapi: optimize the query function of the blockstats Dou Liyang
2016-12-19 15:02 ` [Qemu-devel] [PATCH RFC v2 0/4] block/qapi: refactor and optimize the qmp_query_blockstats() Stefan Hajnoczi
2016-12-19 16:32   ` Fam Zheng
2016-12-20  9:39     ` Stefan Hajnoczi
2016-12-20  9:54       ` Dou Liyang
2016-12-20 10:01         ` Stefan Hajnoczi
2016-12-20 10:26           ` Dou Liyang
2016-12-20 11:09             ` Stefan Hajnoczi
2016-12-21  9:13       ` Dou Liyang
2016-12-21 11:06         ` Stefan Hajnoczi
2016-12-22 10:20           ` Dou Liyang
2016-12-20  9:47     ` Dou Liyang

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).