qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum
Date: Thu, 24 Jun 2021 13:12:22 +0200	[thread overview]
Message-ID: <33d8cf20-39a6-240a-d0a7-22d574183ab0@redhat.com> (raw)
In-Reply-To: <e6ed8b1d-9853-bfa2-15c2-ab75f9e31daf@virtuozzo.com>

On 24.06.21 12:25, Vladimir Sementsov-Ogievskiy wrote:
> 24.06.2021 13:16, Max Reitz wrote:
>> On 24.06.21 11:15, Vladimir Sementsov-Ogievskiy wrote:
>>> 23.06.2021 18:01, Max Reitz wrote:
>>>> .bdrv_co_block_status() implementations are free to return a *pnum 
>>>> that
>>>> exceeds @bytes, because bdrv_co_block_status() in block/io.c will 
>>>> clamp
>>>> *pnum as necessary.
>>>>
>>>> On the other hand, if drivers' implementations return values for *pnum
>>>> that are as large as possible, our recently introduced block-status
>>>> cache will become more effective.
>>>>
>>>> So, make a note in block_int.h that @bytes is no upper limit for 
>>>> *pnum.
>>>>
>>>> Suggested-by: Eric Blake <eblake@redhat.com>
>>>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>>>> ---
>>>>   include/block/block_int.h | 5 +++++
>>>>   1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/include/block/block_int.h b/include/block/block_int.h
>>>> index fcb599dd1c..f85b96ed99 100644
>>>> --- a/include/block/block_int.h
>>>> +++ b/include/block/block_int.h
>>>> @@ -347,6 +347,11 @@ struct BlockDriver {
>>>>        * clamped to bdrv_getlength() and aligned to request_alignment,
>>>>        * as well as non-NULL pnum, map, and file; in turn, the driver
>>>>        * must return an error or set pnum to an aligned non-zero 
>>>> value.
>>>> +     *
>>>> +     * Note that @bytes is just a hint on how big of a region the
>>>> +     * caller wants to inspect.  It is not a limit on *pnum.
>>>> +     * Implementations are free to return larger values of *pnum if
>>>> +     * doing so does not incur a performance penalty.
>>>
>>> Worth mention that the cache will benefit of it?
>>
>> Oh, right, absolutely.  Like so:
>>
>> "block/io.c's bdrv_co_block_status() will clamp *pnum before 
>> returning it to its caller, but it itself can still make use of the 
>> unclamped *pnum value.  Specifically, the block-status cache for 
>> protocol nodes will benefit from storing as large a region as possible."
>>
>
> Sounds good. Do you mean this as an addition or substitution? If the 
> latter, I'd keep "if doing so does not incur a performance penalty 

I meant it as an addition, just a new paragraph.

Max



  reply	other threads:[~2021-06-24 11:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 15:01 [PATCH v2 0/6] block: block-status cache for data regions Max Reitz
2021-06-23 15:01 ` [PATCH v2 1/6] block: Drop BDS comment regarding bdrv_append() Max Reitz
2021-06-23 15:01 ` [PATCH v2 2/6] block: block-status cache for data regions Max Reitz
2021-06-24 10:05   ` Vladimir Sementsov-Ogievskiy
2021-06-24 11:11     ` Max Reitz
2021-07-06 17:04   ` Kevin Wolf
2021-07-12  7:45     ` Max Reitz
2021-06-23 15:01 ` [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum Max Reitz
2021-06-24  9:15   ` Vladimir Sementsov-Ogievskiy
2021-06-24 10:16     ` Max Reitz
2021-06-24 10:25       ` Vladimir Sementsov-Ogievskiy
2021-06-24 11:12         ` Max Reitz [this message]
2021-06-28 19:10       ` Eric Blake
2021-07-12  7:47         ` Max Reitz
2021-06-23 15:01 ` [PATCH v2 4/6] block/file-posix: Do not force-cap *pnum Max Reitz
2021-06-23 15:01 ` [PATCH v2 5/6] block/gluster: " Max Reitz
2021-06-23 15:01 ` [PATCH v2 6/6] block/iscsi: " Max Reitz
2021-07-06 17:06 ` [PATCH v2 0/6] block: block-status cache for data regions Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33d8cf20-39a6-240a-d0a7-22d574183ab0@redhat.com \
    --to=mreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).