mbox

[PULL,00/11] Block layer patches

Message ID 20221111152744.261358-1-kwolf@redhat.com
State New
Headers show

Pull-request

https://repo.or.cz/qemu/kevin.git tags/for-upstream

Message

Kevin Wolf Nov. 11, 2022, 3:27 p.m. UTC
The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4:

  Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into staging (2022-11-09 13:26:45 -0500)

are available in the Git repository at:

  https://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to b04af371af685c12970ea93027dc6d8bf86265aa:

  tests/stream-under-throttle: New test (2022-11-11 13:02:43 +0100)

----------------------------------------------------------------
Block layer patches

- Fix deadlock in graph modification with iothreads
- mirror: Fix non-converging cases for active mirror
- qapi: Fix BlockdevOptionsNvmeIoUring @path description
- blkio: Set BlockDriver::has_variable_length to false

----------------------------------------------------------------
Alberto Faria (2):
      qapi/block-core: Fix BlockdevOptionsNvmeIoUring @path description
      block/blkio: Set BlockDriver::has_variable_length to false

Hanna Reitz (9):
      block/mirror: Do not wait for active writes
      block/mirror: Drop mirror_wait_for_any_operation()
      block/mirror: Fix NULL s->job in active writes
      iotests/151: Test that active mirror progresses
      iotests/151: Test active requests on mirror start
      block: Make bdrv_child_get_parent_aio_context I/O
      block-backend: Update ctx immediately after root
      block: Start/end drain on correct AioContext
      tests/stream-under-throttle: New test

 qapi/block-core.json                               |   2 +-
 include/block/block-global-state.h                 |   1 -
 include/block/block-io.h                           |   2 +
 include/block/block_int-common.h                   |   4 +-
 block.c                                            |   2 +-
 block/blkio.c                                      |   1 -
 block/block-backend.c                              |   9 +-
 block/io.c                                         |   6 +-
 block/mirror.c                                     |  78 ++++---
 blockjob.c                                         |   3 +-
 tests/qemu-iotests/151                             | 227 ++++++++++++++++++++-
 tests/qemu-iotests/151.out                         |   4 +-
 tests/qemu-iotests/tests/stream-under-throttle     | 121 +++++++++++
 tests/qemu-iotests/tests/stream-under-throttle.out |   5 +
 14 files changed, 424 insertions(+), 41 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/stream-under-throttle
 create mode 100644 tests/qemu-iotests/tests/stream-under-throttle.out

Comments

Stefan Hajnoczi Nov. 11, 2022, 7:20 p.m. UTC | #1
On Fri, 11 Nov 2022 at 10:29, Kevin Wolf <kwolf@redhat.com> wrote:
>
> The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4:
>
>   Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into staging (2022-11-09 13:26:45 -0500)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to b04af371af685c12970ea93027dc6d8bf86265aa:
>
>   tests/stream-under-throttle: New test (2022-11-11 13:02:43 +0100)
>
> ----------------------------------------------------------------
> Block layer patches
>
> - Fix deadlock in graph modification with iothreads
> - mirror: Fix non-converging cases for active mirror
> - qapi: Fix BlockdevOptionsNvmeIoUring @path description
> - blkio: Set BlockDriver::has_variable_length to false
>
> ----------------------------------------------------------------
> Alberto Faria (2):
>       qapi/block-core: Fix BlockdevOptionsNvmeIoUring @path description
>       block/blkio: Set BlockDriver::has_variable_length to false
>
> Hanna Reitz (9):
>       block/mirror: Do not wait for active writes
>       block/mirror: Drop mirror_wait_for_any_operation()
>       block/mirror: Fix NULL s->job in active writes
>       iotests/151: Test that active mirror progresses
>       iotests/151: Test active requests on mirror start
>       block: Make bdrv_child_get_parent_aio_context I/O
>       block-backend: Update ctx immediately after root
>       block: Start/end drain on correct AioContext
>       tests/stream-under-throttle: New test

Hi Hanna,
This test is broken, probably due to the minimum Python version:
https://gitlab.com/qemu-project/qemu/-/jobs/3311521303

Stefan
Hanna Czenczek Nov. 14, 2022, 10:12 a.m. UTC | #2
On 11.11.22 20:20, Stefan Hajnoczi wrote:
> On Fri, 11 Nov 2022 at 10:29, Kevin Wolf <kwolf@redhat.com> wrote:
>> The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4:
>>
>>    Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into staging (2022-11-09 13:26:45 -0500)
>>
>> are available in the Git repository at:
>>
>>    https://repo.or.cz/qemu/kevin.git tags/for-upstream
>>
>> for you to fetch changes up to b04af371af685c12970ea93027dc6d8bf86265aa:
>>
>>    tests/stream-under-throttle: New test (2022-11-11 13:02:43 +0100)
>>
>> ----------------------------------------------------------------
>> Block layer patches
>>
>> - Fix deadlock in graph modification with iothreads
>> - mirror: Fix non-converging cases for active mirror
>> - qapi: Fix BlockdevOptionsNvmeIoUring @path description
>> - blkio: Set BlockDriver::has_variable_length to false
>>
>> ----------------------------------------------------------------
>> Alberto Faria (2):
>>        qapi/block-core: Fix BlockdevOptionsNvmeIoUring @path description
>>        block/blkio: Set BlockDriver::has_variable_length to false
>>
>> Hanna Reitz (9):
>>        block/mirror: Do not wait for active writes
>>        block/mirror: Drop mirror_wait_for_any_operation()
>>        block/mirror: Fix NULL s->job in active writes
>>        iotests/151: Test that active mirror progresses
>>        iotests/151: Test active requests on mirror start
>>        block: Make bdrv_child_get_parent_aio_context I/O
>>        block-backend: Update ctx immediately after root
>>        block: Start/end drain on correct AioContext
>>        tests/stream-under-throttle: New test
> Hi Hanna,
> This test is broken, probably due to the minimum Python version:
> https://gitlab.com/qemu-project/qemu/-/jobs/3311521303

:(

I just took the exception name (asyncio.exceptions.TimeoutError) from 
the test output when a timeout occurred, seems indeed like that’s too 
new.  I’m not entirely sure when that was introduced, and what it’s 
relationship to asyncio.TimeoutError is – in 3.11, the latter is an 
alias for the former, but I have 3.10 myself, where the documentation 
says both are distinct.  Anyway, using either works fine here, and the 
existing scripts in python/qemu use asyncio.TimeoutError, so I’ve sent a 
v2 of the patch to do the same.

(For the record, this test isn’t vital for anything, so just dropping it 
from the pull request seems perfectly fine to me.)

Hanna
Kevin Wolf Nov. 14, 2022, 10:56 a.m. UTC | #3
Am 11.11.2022 um 20:20 hat Stefan Hajnoczi geschrieben:
> > Hanna Reitz (9):
> >       block/mirror: Do not wait for active writes
> >       block/mirror: Drop mirror_wait_for_any_operation()
> >       block/mirror: Fix NULL s->job in active writes
> >       iotests/151: Test that active mirror progresses
> >       iotests/151: Test active requests on mirror start
> >       block: Make bdrv_child_get_parent_aio_context I/O
> >       block-backend: Update ctx immediately after root
> >       block: Start/end drain on correct AioContext
> >       tests/stream-under-throttle: New test
> 
> Hi Hanna,
> This test is broken, probably due to the minimum Python version:
> https://gitlab.com/qemu-project/qemu/-/jobs/3311521303

This is exactly the problem I saw with running linters in a gating CI,
but not during 'make check'. And of course, we're hitting it during the
-rc phase now. :-(

But yes, it seems that asyncio.TimeoutError should be used instead of
asyncio.exceptions.TimeoutError, and Python 3.6 has only the former.
I'll fix this up and send a v2 if it fixes check-python-pipenv.

Kevin
John Snow Nov. 14, 2022, 11:58 p.m. UTC | #4
On Mon, Nov 14, 2022 at 5:56 AM Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 11.11.2022 um 20:20 hat Stefan Hajnoczi geschrieben:
> > > Hanna Reitz (9):
> > >       block/mirror: Do not wait for active writes
> > >       block/mirror: Drop mirror_wait_for_any_operation()
> > >       block/mirror: Fix NULL s->job in active writes
> > >       iotests/151: Test that active mirror progresses
> > >       iotests/151: Test active requests on mirror start
> > >       block: Make bdrv_child_get_parent_aio_context I/O
> > >       block-backend: Update ctx immediately after root
> > >       block: Start/end drain on correct AioContext
> > >       tests/stream-under-throttle: New test
> >
> > Hi Hanna,
> > This test is broken, probably due to the minimum Python version:
> > https://gitlab.com/qemu-project/qemu/-/jobs/3311521303
>
> This is exactly the problem I saw with running linters in a gating CI,
> but not during 'make check'. And of course, we're hitting it during the
> -rc phase now. :-(

I mean. I'd love to have it run in make check too. The alternative was
never seeing this *anywhere* ...

...but I'm sorry it's taken me so long to figure out how to get this
stuff to work in "make check" and also from manual iotests runs
without adding any kind of setup that you have to manage. It's just
fiddly, sorry :(

>
> But yes, it seems that asyncio.TimeoutError should be used instead of
> asyncio.exceptions.TimeoutError, and Python 3.6 has only the former.
> I'll fix this up and send a v2 if it fixes check-python-pipenv.

Hopefully this goes away when we drop 3.6. I want to, but I recall
there was some question about some platforms that don't support 3.7+
"by default" and how annoying that was or wasn't. We're almost a year
out from 3.6 being EOL, so maybe after this release it's worth a crack
to see how painful it is to move on.

>
> Kevin
>
Kevin Wolf Nov. 15, 2022, 10:14 a.m. UTC | #5
Am 15.11.2022 um 00:58 hat John Snow geschrieben:
> On Mon, Nov 14, 2022 at 5:56 AM Kevin Wolf <kwolf@redhat.com> wrote:
> >
> > Am 11.11.2022 um 20:20 hat Stefan Hajnoczi geschrieben:
> > > > Hanna Reitz (9):
> > > >       block/mirror: Do not wait for active writes
> > > >       block/mirror: Drop mirror_wait_for_any_operation()
> > > >       block/mirror: Fix NULL s->job in active writes
> > > >       iotests/151: Test that active mirror progresses
> > > >       iotests/151: Test active requests on mirror start
> > > >       block: Make bdrv_child_get_parent_aio_context I/O
> > > >       block-backend: Update ctx immediately after root
> > > >       block: Start/end drain on correct AioContext
> > > >       tests/stream-under-throttle: New test
> > >
> > > Hi Hanna,
> > > This test is broken, probably due to the minimum Python version:
> > > https://gitlab.com/qemu-project/qemu/-/jobs/3311521303
> >
> > This is exactly the problem I saw with running linters in a gating CI,
> > but not during 'make check'. And of course, we're hitting it during the
> > -rc phase now. :-(
> 
> I mean. I'd love to have it run in make check too. The alternative was
> never seeing this *anywhere* ...

What is the problem with running it in 'make check'? The additional
dependencies? If so, can we run it automatically if the dependencies
happen to be fulfilled and just skip it otherwise?

If I have to run 'make -C python check-pipenv' manually, I can guarantee
you that I'll forget it more often than I'll run it.

> ...but I'm sorry it's taken me so long to figure out how to get this
> stuff to work in "make check" and also from manual iotests runs
> without adding any kind of setup that you have to manage. It's just
> fiddly, sorry :(
> 
> >
> > But yes, it seems that asyncio.TimeoutError should be used instead of
> > asyncio.exceptions.TimeoutError, and Python 3.6 has only the former.
> > I'll fix this up and send a v2 if it fixes check-python-pipenv.
> 
> Hopefully this goes away when we drop 3.6. I want to, but I recall
> there was some question about some platforms that don't support 3.7+
> "by default" and how annoying that was or wasn't. We're almost a year
> out from 3.6 being EOL, so maybe after this release it's worth a crack
> to see how painful it is to move on.

If I understand the documentation right, asyncio.TimeoutError is what
you should be using either way. That it happens to be a re-export from
the internal module asyncio.exceptions seems to be more of an
implementation detail, not the official interface.

Kevin
Hanna Czenczek Nov. 15, 2022, 10:21 a.m. UTC | #6
On 15.11.22 11:14, Kevin Wolf wrote:
> Am 15.11.2022 um 00:58 hat John Snow geschrieben:
>> On Mon, Nov 14, 2022 at 5:56 AM Kevin Wolf <kwolf@redhat.com> wrote:
>>> Am 11.11.2022 um 20:20 hat Stefan Hajnoczi geschrieben:
>>>>> Hanna Reitz (9):
>>>>>        block/mirror: Do not wait for active writes
>>>>>        block/mirror: Drop mirror_wait_for_any_operation()
>>>>>        block/mirror: Fix NULL s->job in active writes
>>>>>        iotests/151: Test that active mirror progresses
>>>>>        iotests/151: Test active requests on mirror start
>>>>>        block: Make bdrv_child_get_parent_aio_context I/O
>>>>>        block-backend: Update ctx immediately after root
>>>>>        block: Start/end drain on correct AioContext
>>>>>        tests/stream-under-throttle: New test
>>>> Hi Hanna,
>>>> This test is broken, probably due to the minimum Python version:
>>>> https://gitlab.com/qemu-project/qemu/-/jobs/3311521303
>>> This is exactly the problem I saw with running linters in a gating CI,
>>> but not during 'make check'. And of course, we're hitting it during the
>>> -rc phase now. :-(
>> I mean. I'd love to have it run in make check too. The alternative was
>> never seeing this *anywhere* ...
> What is the problem with running it in 'make check'? The additional
> dependencies? If so, can we run it automatically if the dependencies
> happen to be fulfilled and just skip it otherwise?
>
> If I have to run 'make -C python check-pipenv' manually, I can guarantee
> you that I'll forget it more often than I'll run it.
>
>> ...but I'm sorry it's taken me so long to figure out how to get this
>> stuff to work in "make check" and also from manual iotests runs
>> without adding any kind of setup that you have to manage. It's just
>> fiddly, sorry :(
>>
>>> But yes, it seems that asyncio.TimeoutError should be used instead of
>>> asyncio.exceptions.TimeoutError, and Python 3.6 has only the former.
>>> I'll fix this up and send a v2 if it fixes check-python-pipenv.
>> Hopefully this goes away when we drop 3.6. I want to, but I recall
>> there was some question about some platforms that don't support 3.7+
>> "by default" and how annoying that was or wasn't. We're almost a year
>> out from 3.6 being EOL, so maybe after this release it's worth a crack
>> to see how painful it is to move on.
> If I understand the documentation right, asyncio.TimeoutError is what
> you should be using either way. That it happens to be a re-export from
> the internal module asyncio.exceptions seems to be more of an
> implementation detail, not the official interface.

Oh, so I understood 
https://docs.python.org/3/library/asyncio-exceptions.html wrong.  I took 
that to mean that as of 3.11, `asyncio.TimeoutError` is a deprecated 
alias for `asyncio.exceptions.TimeoutError`, but it’s actually become an 
alias for the now-built-in `TimeoutError` exception.  I think.

Hanna
Kevin Wolf Nov. 15, 2022, 3:32 p.m. UTC | #7
Am 15.11.2022 um 11:21 hat Hanna Reitz geschrieben:
> On 15.11.22 11:14, Kevin Wolf wrote:
> > Am 15.11.2022 um 00:58 hat John Snow geschrieben:
> > > On Mon, Nov 14, 2022 at 5:56 AM Kevin Wolf <kwolf@redhat.com> wrote:
> > > > Am 11.11.2022 um 20:20 hat Stefan Hajnoczi geschrieben:
> > > > > > Hanna Reitz (9):
> > > > > >        block/mirror: Do not wait for active writes
> > > > > >        block/mirror: Drop mirror_wait_for_any_operation()
> > > > > >        block/mirror: Fix NULL s->job in active writes
> > > > > >        iotests/151: Test that active mirror progresses
> > > > > >        iotests/151: Test active requests on mirror start
> > > > > >        block: Make bdrv_child_get_parent_aio_context I/O
> > > > > >        block-backend: Update ctx immediately after root
> > > > > >        block: Start/end drain on correct AioContext
> > > > > >        tests/stream-under-throttle: New test
> > > > > Hi Hanna,
> > > > > This test is broken, probably due to the minimum Python version:
> > > > > https://gitlab.com/qemu-project/qemu/-/jobs/3311521303
> > > > This is exactly the problem I saw with running linters in a gating CI,
> > > > but not during 'make check'. And of course, we're hitting it during the
> > > > -rc phase now. :-(
> > > I mean. I'd love to have it run in make check too. The alternative was
> > > never seeing this *anywhere* ...
> > What is the problem with running it in 'make check'? The additional
> > dependencies? If so, can we run it automatically if the dependencies
> > happen to be fulfilled and just skip it otherwise?
> > 
> > If I have to run 'make -C python check-pipenv' manually, I can guarantee
> > you that I'll forget it more often than I'll run it.
> > 
> > > ...but I'm sorry it's taken me so long to figure out how to get this
> > > stuff to work in "make check" and also from manual iotests runs
> > > without adding any kind of setup that you have to manage. It's just
> > > fiddly, sorry :(
> > > 
> > > > But yes, it seems that asyncio.TimeoutError should be used instead of
> > > > asyncio.exceptions.TimeoutError, and Python 3.6 has only the former.
> > > > I'll fix this up and send a v2 if it fixes check-python-pipenv.
> > > Hopefully this goes away when we drop 3.6. I want to, but I recall
> > > there was some question about some platforms that don't support 3.7+
> > > "by default" and how annoying that was or wasn't. We're almost a year
> > > out from 3.6 being EOL, so maybe after this release it's worth a crack
> > > to see how painful it is to move on.
> > If I understand the documentation right, asyncio.TimeoutError is what
> > you should be using either way. That it happens to be a re-export from
> > the internal module asyncio.exceptions seems to be more of an
> > implementation detail, not the official interface.
> 
> Oh, so I understood
> https://docs.python.org/3/library/asyncio-exceptions.html wrong.  I took
> that to mean that as of 3.11, `asyncio.TimeoutError` is a deprecated alias
> for `asyncio.exceptions.TimeoutError`, but it’s actually become an alias for
> the now-built-in `TimeoutError` exception.  I think.

Not just "now-built-in", it has been built in before (starting from
3.3). But AIUI, asyncio used to use its own separate exception class
(asyncio.TimeoutError, in some versions re-exported from the exceptions
submodule) instead of the built-in one, and in 3.11 it now reuses the
built-in one instead of defining a separate custom one.

Kevin