mbox series

[v4,00/16] 64bit block-layer: part I

Message ID 20201211183934.169161-1-vsementsov@virtuozzo.com (mailing list archive)
Headers show
Series 64bit block-layer: part I | expand

Message

Vladimir Sementsov-Ogievskiy Dec. 11, 2020, 6:39 p.m. UTC
Hi all!

We want 64bit write-zeroes, and for this, convert all io functions to
64bit.

We chose signed type, to be consistent with off_t (which is signed) and
with possibility for signed return type (where negative value means
error).

Please refer to initial cover-letter 
 https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08723.html
for more info.

v4: I found, that some more work is needed for block/block-backend, so
decided to make partI, converting block/io

v4 is based on Kevin's block branch ([PULL 00/34] Block layer patches)
   for BDRV_MAX_LENGTH

changes:
01-05: new
06: add Alberto's r-b
07: new
08-16: rebase, add new-style request check, improve commit-msg, drop r-bs

Based-on: <20201211170812.228643-1-kwolf@redhat.com>

Vladimir Sementsov-Ogievskiy (16):
  block: refactor bdrv_check_request: add errp
  util/iov: make qemu_iovec_init_extended() honest
  block: fix theoretical overflow in bdrv_init_padding()
  block/io: refactor bdrv_pad_request(): move bdrv_pad_request() up
  block/io: bdrv_pad_request(): support qemu_iovec_init_extended failure
  block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit
    bytes
  block/io: improve bdrv_check_request: check qiov too
  block: use int64_t as bytes type in tracked requests
  block/io: use int64_t bytes in driver wrappers
  block/io: support int64_t bytes in bdrv_co_do_pwrite_zeroes()
  block/io: support int64_t bytes in bdrv_aligned_pwritev()
  block/io: support int64_t bytes in bdrv_co_do_copy_on_readv()
  block/io: support int64_t bytes in bdrv_aligned_preadv()
  block/io: support int64_t bytes in bdrv_co_p{read,write}v_part()
  block/io: support int64_t bytes in read/write wrappers
  block/io: use int64_t bytes in copy_range

 include/block/block.h           |  17 +-
 include/block/block_int.h       |  26 +--
 include/block/throttle-groups.h |   2 +-
 include/qemu/iov.h              |   2 +-
 block/blkverify.c               |   2 +-
 block/file-posix.c              |   2 +-
 block/io.c                      | 274 ++++++++++++++++++++++----------
 block/throttle-groups.c         |   5 +-
 tests/test-write-threshold.c    |   5 +-
 util/iov.c                      |  25 ++-
 block/trace-events              |  12 +-
 11 files changed, 252 insertions(+), 120 deletions(-)

Comments

Vladimir Sementsov-Ogievskiy Dec. 14, 2020, 11:51 a.m. UTC | #1
11.12.2020 21:39, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> We want 64bit write-zeroes, and for this, convert all io functions to
> 64bit.
> 
> We chose signed type, to be consistent with off_t (which is signed) and
> with possibility for signed return type (where negative value means
> error).
> 
> Please refer to initial cover-letter
>   https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08723.html
> for more info.
> 
> v4: I found, that some more work is needed for block/block-backend, so
> decided to make partI, converting block/io
> 
> v4 is based on Kevin's block branch ([PULL 00/34] Block layer patches)
>     for BDRV_MAX_LENGTH
> 
> changes:
> 01-05: new
> 06: add Alberto's r-b
> 07: new
> 08-16: rebase, add new-style request check, improve commit-msg, drop r-bs
> 
> Based-on:<20201211170812.228643-1-kwolf@redhat.com>


Now based on master.
Vladimir Sementsov-Ogievskiy Jan. 9, 2021, 10:13 a.m. UTC | #2
ping

11.12.2020 21:39, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> We want 64bit write-zeroes, and for this, convert all io functions to
> 64bit.
> 
> We chose signed type, to be consistent with off_t (which is signed) and
> with possibility for signed return type (where negative value means
> error).
> 
> Please refer to initial cover-letter
>   https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08723.html
> for more info.
> 
> v4: I found, that some more work is needed for block/block-backend, so
> decided to make partI, converting block/io
> 
> v4 is based on Kevin's block branch ([PULL 00/34] Block layer patches)
>     for BDRV_MAX_LENGTH
> 
> changes:
> 01-05: new
> 06: add Alberto's r-b
> 07: new
> 08-16: rebase, add new-style request check, improve commit-msg, drop r-bs
> 
> Based-on: <20201211170812.228643-1-kwolf@redhat.com>
> 
> Vladimir Sementsov-Ogievskiy (16):
>    block: refactor bdrv_check_request: add errp
>    util/iov: make qemu_iovec_init_extended() honest
>    block: fix theoretical overflow in bdrv_init_padding()
>    block/io: refactor bdrv_pad_request(): move bdrv_pad_request() up
>    block/io: bdrv_pad_request(): support qemu_iovec_init_extended failure
>    block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit
>      bytes
>    block/io: improve bdrv_check_request: check qiov too
>    block: use int64_t as bytes type in tracked requests
>    block/io: use int64_t bytes in driver wrappers
>    block/io: support int64_t bytes in bdrv_co_do_pwrite_zeroes()
>    block/io: support int64_t bytes in bdrv_aligned_pwritev()
>    block/io: support int64_t bytes in bdrv_co_do_copy_on_readv()
>    block/io: support int64_t bytes in bdrv_aligned_preadv()
>    block/io: support int64_t bytes in bdrv_co_p{read,write}v_part()
>    block/io: support int64_t bytes in read/write wrappers
>    block/io: use int64_t bytes in copy_range
> 
>   include/block/block.h           |  17 +-
>   include/block/block_int.h       |  26 +--
>   include/block/throttle-groups.h |   2 +-
>   include/qemu/iov.h              |   2 +-
>   block/blkverify.c               |   2 +-
>   block/file-posix.c              |   2 +-
>   block/io.c                      | 274 ++++++++++++++++++++++----------
>   block/throttle-groups.c         |   5 +-
>   tests/test-write-threshold.c    |   5 +-
>   util/iov.c                      |  25 ++-
>   block/trace-events              |  12 +-
>   11 files changed, 252 insertions(+), 120 deletions(-)
>
Eric Blake Feb. 2, 2021, 2:56 a.m. UTC | #3
On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> We want 64bit write-zeroes, and for this, convert all io functions to
> 64bit.
> 
> We chose signed type, to be consistent with off_t (which is signed) and
> with possibility for signed return type (where negative value means
> error).
> 
> Please refer to initial cover-letter 
>  https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08723.html
> for more info.
> 
> v4: I found, that some more work is needed for block/block-backend, so
> decided to make partI, converting block/io
> 
> v4 is based on Kevin's block branch ([PULL 00/34] Block layer patches)
>    for BDRV_MAX_LENGTH
> 
> changes:
> 01-05: new
> 06: add Alberto's r-b
> 07: new
> 08-16: rebase, add new-style request check, improve commit-msg, drop r-bs

I had planned to send a pull request for this series today, but ran into
a snag.  Without this series applied, './check -qcow2' fails 030, 185,
and 297.  With it applied, I now also get a failure in 206.  I'm trying
to bisect which patch caused the problem, but here's the failure:

206   fail       [20:54:54] [20:55:01]   6.9s   (last: 6.7s)  output
mismatch (see 206.out.bad)
--- /home/eblake/qemu/tests/qemu-iotests/206.out
+++ 206.out.bad
@@ -180,7 +180,7 @@

 {"execute": "blockdev-create", "arguments": {"job-id": "job0",
"options": {"driver": "qcow2", "file": "node0", "size":
9223372036854775296}}}
 {"return": {}}
-Job failed: Could not resize image: Required too big image size, it
must be not greater than 9223372035781033984
+Job failed: Could not resize image: offset(9223372036854775296) exceeds
maximum(9223372035781033984)
 {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 {"return": {}}

Looks like it is just a changed error message, so I can touch up the
correct patch and then repackage the pull request tomorrow (it's too
late for me today).  Oh, and the 0 exit status of ./check when a test
fails is something I see you already plan on fixing...
Vladimir Sementsov-Ogievskiy Feb. 2, 2021, 6:50 a.m. UTC | #4
02.02.2021 05:56, Eric Blake wrote:
> On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote:
>> Hi all!
>>
>> We want 64bit write-zeroes, and for this, convert all io functions to
>> 64bit.
>>
>> We chose signed type, to be consistent with off_t (which is signed) and
>> with possibility for signed return type (where negative value means
>> error).
>>
>> Please refer to initial cover-letter
>>   https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08723.html
>> for more info.
>>
>> v4: I found, that some more work is needed for block/block-backend, so
>> decided to make partI, converting block/io
>>
>> v4 is based on Kevin's block branch ([PULL 00/34] Block layer patches)
>>     for BDRV_MAX_LENGTH
>>
>> changes:
>> 01-05: new
>> 06: add Alberto's r-b
>> 07: new
>> 08-16: rebase, add new-style request check, improve commit-msg, drop r-bs
> 
> I had planned to send a pull request for this series today, but ran into
> a snag.  Without this series applied, './check -qcow2' fails 030, 185,
> and 297.  With it applied, I now also get a failure in 206.  I'm trying
> to bisect which patch caused the problem, but here's the failure:
> 
> 206   fail       [20:54:54] [20:55:01]   6.9s   (last: 6.7s)  output
> mismatch (see 206.out.bad)
> --- /home/eblake/qemu/tests/qemu-iotests/206.out
> +++ 206.out.bad
> @@ -180,7 +180,7 @@
> 
>   {"execute": "blockdev-create", "arguments": {"job-id": "job0",
> "options": {"driver": "qcow2", "file": "node0", "size":
> 9223372036854775296}}}
>   {"return": {}}
> -Job failed: Could not resize image: Required too big image size, it
> must be not greater than 9223372035781033984
> +Job failed: Could not resize image: offset(9223372036854775296) exceeds
> maximum(9223372035781033984)
>   {"execute": "job-dismiss", "arguments": {"id": "job0"}}
>   {"return": {}}
> 
> Looks like it is just a changed error message, so I can touch up the
> correct patch and then repackage the pull request tomorrow (it's too
> late for me today).  Oh, and the 0 exit status of ./check when a test
> fails is something I see you already plan on fixing...
> 

Yes, Kevin have already sent a pull with "iotests: check: return 1 on failure"
Eric Blake Feb. 2, 2021, 2:59 p.m. UTC | #5
On 2/1/21 8:56 PM, Eric Blake wrote:
> I had planned to send a pull request for this series today, but ran into
> a snag.  Without this series applied, './check -qcow2' fails 030, 185,
> and 297.  With it applied, I now also get a failure in 206.  I'm trying
> to bisect which patch caused the problem, but here's the failure:
> 
> 206   fail       [20:54:54] [20:55:01]   6.9s   (last: 6.7s)  output
> mismatch (see 206.out.bad)
> --- /home/eblake/qemu/tests/qemu-iotests/206.out
> +++ 206.out.bad
> @@ -180,7 +180,7 @@
> 
>  {"execute": "blockdev-create", "arguments": {"job-id": "job0",
> "options": {"driver": "qcow2", "file": "node0", "size":
> 9223372036854775296}}}
>  {"return": {}}
> -Job failed: Could not resize image: Required too big image size, it
> must be not greater than 9223372035781033984
> +Job failed: Could not resize image: offset(9223372036854775296) exceeds
> maximum(9223372035781033984)
>  {"execute": "job-dismiss", "arguments": {"id": "job0"}}
>  {"return": {}}
> 
> Looks like it is just a changed error message, so I can touch up the
> correct patch and then repackage the pull request

Culprit was "block: refactor bdrv_check_request: add errp".  I'm
preparing the pull request now.