[PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections

Vladimir Sementsov-Ogievskiy posted 9 patches 4 years ago
Test docker-mingw@fedora failed
Test docker-quick@centos7 failed
Test checkpatch passed
Test FreeBSD failed
Test asan failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200408093051.9893-1-vsementsov@virtuozzo.com
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
block/io.c | 780 +++++++++++++++++++++++++++++++++++------------------
1 file changed, 516 insertions(+), 264 deletions(-)
[PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by Vladimir Sementsov-Ogievskiy 4 years ago
Hi all!

This is inspired by Kevin's
"block: Fix blk->in_flight during blk_wait_while_drained()" series.

So, like it's now done for block-backends, let's expand
in_flight-protected sections for bdrv_ interfaces, including
coroutine_enter and BDRV_POLL_WHILE loop into these sections.

Vladimir Sementsov-Ogievskiy (9):
  block/io: refactor bdrv_is_allocated_above to run only one coroutine
  block/io: refactor bdrv_co_ioctl: move aio stuff to corresponding
    block
  block/io: move flush and pdiscard stuff down
  block/io: move bdrv_rw_co_entry and friends down
  block/io: expand in_flight inc/dec section: simple cases
  block/io: expand in_flight inc/dec section: block-status
  block/io: add bdrv_do_pwrite_zeroes
  block/io: move bdrv_make_zero under block-status
  block/io: expand in_flight inc/dec section: bdrv_make_zero

 block/io.c | 780 +++++++++++++++++++++++++++++++++++------------------
 1 file changed, 516 insertions(+), 264 deletions(-)

-- 
2.21.0


Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by Stefan Hajnoczi 4 years ago
On Wed, Apr 08, 2020 at 12:30:42PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> This is inspired by Kevin's
> "block: Fix blk->in_flight during blk_wait_while_drained()" series.
> 
> So, like it's now done for block-backends, let's expand
> in_flight-protected sections for bdrv_ interfaces, including
> coroutine_enter and BDRV_POLL_WHILE loop into these sections.

This looks like a code improvement but let's leave it for the next
release since QEMU 5.0 is in freeze and this patch series does not fix a
specific user-visible bug.

I will review this in depth next week.  Thanks!

Stefan
Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by Vladimir Sementsov-Ogievskiy 4 years ago
09.04.2020 20:00, Stefan Hajnoczi wrote:
> On Wed, Apr 08, 2020 at 12:30:42PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> Hi all!
>>
>> This is inspired by Kevin's
>> "block: Fix blk->in_flight during blk_wait_while_drained()" series.
>>
>> So, like it's now done for block-backends, let's expand
>> in_flight-protected sections for bdrv_ interfaces, including
>> coroutine_enter and BDRV_POLL_WHILE loop into these sections.
> 
> This looks like a code improvement but let's leave it for the next
> release since QEMU 5.0 is in freeze and this patch series does not fix a
> specific user-visible bug.
> 
> I will review this in depth next week.  Thanks!
> 

Hmm, it possibly fixes some bugs, but at least I didn't see them :) Anyway, it shouldn't be a degradation.

-- 
Best regards,
Vladimir

Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsementsov@virtuozzo.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      crypto/tlssession.o
  CC      crypto/secret.o
/tmp/qemu-test/src/block/io.c: In function 'bdrv_co_pdiscard':
/tmp/qemu-test/src/block/io.c:3236:23: error: unused variable 'bs' [-Werror=unused-variable]
     BlockDriverState *bs = child->bs;
                       ^
cc1: all warnings being treated as errors
make: *** [block/io.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=a0f1e41cc0a74bd7a341e17a6e374b91', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-jzfd32f9/src/docker-src.2020-04-08-06.20.30.5705:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=a0f1e41cc0a74bd7a341e17a6e374b91
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-jzfd32f9/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m13.993s
user    0m8.229s


The full log is available at
http://patchew.org/logs/20200408093051.9893-1-vsementsov@virtuozzo.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsementsov@virtuozzo.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      qemu-storage-daemon.o
  CC      chardev/char.o
  CC      chardev/char-fd.o
/tmp/qemu-test/src/block/io.c:3236:23: error: unused variable 'bs' [-Werror,-Wunused-variable]
    BlockDriverState *bs = child->bs;
                      ^
1 error generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: block/io.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=fe09506e16304737ad88a479330eedd0', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-p88wn5d0/src/docker-src.2020-04-08-06.11.00.19577:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=fe09506e16304737ad88a479330eedd0
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-p88wn5d0/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m59.109s
user    0m8.928s


The full log is available at
http://patchew.org/logs/20200408093051.9893-1-vsementsov@virtuozzo.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsementsov@virtuozzo.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
/tmp/qemu-test/src/block/io.c: In function 'bdrv_co_pdiscard':
/tmp/qemu-test/src/block/io.c:3236:23: error: unused variable 'bs' [-Werror=unused-variable]
     BlockDriverState *bs = child->bs;
                       ^~
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: block/io.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=0a3c46e828f54c7eacc85733f086e093', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-9znq69ii/src/docker-src.2020-04-08-06.23.18.12334:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=0a3c46e828f54c7eacc85733f086e093
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-9znq69ii/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    2m12.399s
user    0m8.326s


The full log is available at
http://patchew.org/logs/20200408093051.9893-1-vsementsov@virtuozzo.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com