Skip to contentSkip to conversation

Docker and block patches

GIT PULL Applied Fam Zheng 2 participants 3 messages Jun 16, 2017 – Jun 20, 2017 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

The following changes since commit edf8bc98424d62035d5e4c0f39542722d72d7979:

Merge remote-tracking branch 'remotes/rth/tags/pull-s390-20170613' into staging (2017-06-15 13:45:15 +0100)

are available in the git repository at:

git://github.com/famz/qemu.git tags/docker-and-block-pull-request

for you to fetch changes up to 5b50bf77ce6e773b04a303a2912876c9a1bfca43:

block: make accounting thread-safe (2017-06-16 07:55:00 +0800)

----------------------------------------------------------------

----------------------------------------------------------------

Fam Zheng (4):
docker: Run tests with current user
docker: Add bzip2 and hostname to fedora image
docker: Add libaio to fedora image
docker: Add flex and bison to centos6 image

Paolo Bonzini (19):
block: access copy_on_read with atomic ops
block: access quiesce_counter with atomic ops
block: access io_limits_disabled with atomic ops
block: access serialising_in_flight with atomic ops
block: access wakeup with atomic ops
block: access io_plugged with atomic ops
throttle-groups: only start one coroutine from drained_begin
throttle-groups: do not use qemu_co_enter_next
throttle-groups: protect throttled requests with a CoMutex
util: add stats64 module
block: use Stat64 for wr_highest_offset
block: access write_gen with atomics
block: protect tracked_requests and flush_queue with reqs_lock
block: introduce dirty_bitmap_mutex
migration/block: reset dirty bitmap before reading
block: protect modification of dirty bitmaps with a mutex
block: introduce block_account_one_io
block: split BlockAcctStats creation and setup
block: make accounting thread-safe

 block.c                                 |  10 +-
 block/accounting.c                      |  78 +++++++------
 block/block-backend.c                   |   6 +-
 block/dirty-bitmap.c                    | 114 +++++++++++++++++--
 block/io.c                              |  51 +++++----
 block/mirror.c                          |  14 ++-
 block/nfs.c                             |   4 +-
 block/qapi.c                            |   2 +-
 block/sheepdog.c                        |   3 +-
 block/throttle-groups.c                 |  91 +++++++++++----
 blockdev.c                              |  48 ++------
 include/block/accounting.h              |  11 +-
 include/block/block.h                   |   5 +-
 include/block/block_int.h               |  65 +++++++----
 include/block/dirty-bitmap.h            |  25 +++--
 include/qemu/stats64.h                  | 193 ++++++++++++++++++++++++++++++++
 include/sysemu/block-backend.h          |  10 +-
 migration/block.c                       |  17 ++-
 tests/docker/Makefile.include           |   2 +-
 tests/docker/dockerfiles/centos6.docker |   2 +-
 tests/docker/dockerfiles/fedora.docker  |   4 +-
 util/Makefile.objs                      |   1 +
 util/stats64.c                          | 137 +++++++++++++++++++++++
 23 files changed, 701 insertions(+), 192 deletions(-)
 create mode 100644 include/qemu/stats64.h
 create mode 100644 util/stats64.c
Signature · 1 line
2.9.4
author
#1 lore raw

[Qemu-devel] [PULL v4 18/23] block: introduce dirty_bitmap_mutex

From: Paolo Bonzini <[email protected]>

It protects only the list of dirty bitmaps; in the next patch we will also protect their content.

Message-Id: <[email protected]>

---
 block.c                   |  1 +
 block/dirty-bitmap.c      | 44 +++++++++++++++++++++++++++++++++++++++++++-
 block/mirror.c            |  3 ++-
 blockdev.c                | 44 +++++++-------------------------------------
 include/block/block_int.h |  5 +++++
 migration/block.c         |  6 ------
 6 files changed, 58 insertions(+), 45 deletions(-)
block.c +1 -0
index a5cbd45..6943962 100644
@@ -321,6 +321,7 @@ BlockDriverState *bdrv_new(void)
     }
     notifier_with_return_list_init(&bs->before_write_notifiers);
     qemu_co_mutex_init(&bs->reqs_lock);
+    qemu_mutex_init(&bs->dirty_bitmap_mutex);
     bs->refcnt = 1;
     bs->aio_context = qemu_get_aio_context();
 
block/dirty-bitmap.c +43 -1

184 lines not on this page · raw message

block/mirror.c +2 -1
index a2a9703..88ae882 100644
@@ -506,6 +506,8 @@ static void mirror_exit(BlockJob *job, void *opaque)
     BlockDriverState *mirror_top_bs = s->mirror_top_bs;
     Error *local_err = NULL;
 
+    bdrv_release_dirty_bitmap(src, s->dirty_bitmap);
+
     /* Make sure that the source BDS doesn't go away before we called
      * block_job_completed(). */
     bdrv_ref(src);
@@ -904,7 +906,6 @@ immediate_exit:
     g_free(s->cow_bitmap);
     g_free(s->in_flight_bitmap);
     bdrv_dirty_iter_free(s->dbi);
-    bdrv_release_dirty_bitmap(bs, s->dirty_bitmap);
 
     data = g_malloc(sizeof(*data));
     data->ret = ret;
blockdev.c +7 -37

137 lines not on this page · raw message

include/block/block_int.h +5 -0
index ae74df9..21cb65b 100644
@@ -609,6 +609,11 @@ struct BlockDriverState {
     uint64_t write_threshold_offset;
     NotifierWithReturn write_threshold_notifier;
 
+    /* Writing to the list requires the BQL _and_ the dirty_bitmap_mutex.
+     * Reading from the list can be done with either the BQL or the
+     * dirty_bitmap_mutex.  Modifying a bitmap requires the AioContext
+     * lock.  */
+    QemuMutex dirty_bitmap_mutex;
     QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps;
 
     /* Offset after the highest byte written to */
migration/block.c +0 -6
index 3aae5a3..9e20926 100644
@@ -341,10 +341,8 @@ static int set_dirty_tracking(void)
     int ret;
 
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
-        aio_context_acquire(blk_get_aio_context(bmds->blk));
         bmds->dirty_bitmap = bdrv_create_dirty_bitmap(blk_bs(bmds->blk),
                                                       BLOCK_SIZE, NULL, NULL);
-        aio_context_release(blk_get_aio_context(bmds->blk));
         if (!bmds->dirty_bitmap) {
             ret = -errno;
             goto fail;
@@ -355,9 +353,7 @@ static int set_dirty_tracking(void)
 fail:
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
         if (bmds->dirty_bitmap) {
-            aio_context_acquire(blk_get_aio_context(bmds->blk));
             bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap);
-            aio_context_release(blk_get_aio_context(bmds->blk));
         }
     }
     return ret;
@@ -370,9 +366,7 @@ static void unset_dirty_tracking(void)
     BlkMigDevState *bmds;
 
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
-        aio_context_acquire(blk_get_aio_context(bmds->blk));
         bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap);
-        aio_context_release(blk_get_aio_context(bmds->blk));
     }
 }
 
Signature · 1 line
2.9.4
#2 lore raw
In reply to Fam Zheng
Quoted 8 lines · Fam Zheng

The following changes since commit edf8bc98424d62035d5e4c0f39542722d72d7979:

Merge remote-tracking branch 'remotes/rth/tags/pull-s390-20170613' into staging (2017-06-15 13:45:15 +0100)

are available in the git repository at:

git://github.com/famz/qemu.git tags/docker-and-block-pull-request

Quoted 8 lines

for you to fetch changes up to 5b50bf77ce6e773b04a303a2912876c9a1bfca43:

block: make accounting thread-safe (2017-06-16 07:55:00 +0800)

----------------------------------------------------------------

----------------------------------------------------------------

Applied, thanks.

-- PMM