All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, jcody@redhat.com,
	mreitz@redhat.com, pbonzini@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v3 1/8] dirty-bitmap: improve bdrv_dirty_bitmap_next_zero
Date: Mon, 10 Sep 2018 20:00:38 +0300	[thread overview]
Message-ID: <0f8ecd93-3320-99aa-44aa-c8b11717c784@virtuozzo.com> (raw)
In-Reply-To: <f50d72a0-7fa7-d2b9-3010-2e9ad10a574b@redhat.com>

10.09.2018 19:55, Eric Blake wrote:
> On 9/10/18 11:49 AM, Vladimir Sementsov-Ogievskiy wrote:
>
>>>> -int64_t hbitmap_next_zero(const HBitmap *hb, uint64_t start);
>>>> +int64_t hbitmap_next_zero(const HBitmap *hb, uint64_t start, 
>>>> int64_t end);
>>> The interface looks weird because we can define a 'start' that's beyond
>>> the 'end'.
>>>
>>> I realize that you need a signed integer for 'end' to signify EOF...
>>> should we do a 'bytes' parameter instead? (Did you already do that 
>>> in an
>>> earlier version and we changed it?)
>>>
>>> Well, it's not a big deal to me personally.
>>
>> interface with constant end parameter is more comfortable for loop: 
>> we don't need to update 'bytes' parameter on each iteration
>
> But there's still the question of WHO should be calculating end. Your 
> interface argues for the caller:
>
> hbitmap_next_zero(start, start + bytes)
>
> int64_t hbitmap_next_zero(...)
> {
>     while (offset != end) ...
> }
>
> while we're asking about a consistent interface for the caller (if 
> most callers already have a 'bytes' rather than an 'end' computed):
>
> hbitmap_next_zero(start, bytes)
>
> int64_t hbitmap_next_zero(...)
> {
>     int64_t end = start + bytes;
>     while (offset != end) ...
> }
>

Yes, that's an issue. Ok, if you are not comfortable with start,end, I 
can switch to start,bytes.

-- 
Best regards,
Vladimir

  reply	other threads:[~2018-09-10 17:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 12:14 [Qemu-devel] [PATCH v3 0/8] dirty-bitmap: rewrite bdrv_dirty_iter_next_area Vladimir Sementsov-Ogievskiy
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 1/8] dirty-bitmap: improve bdrv_dirty_bitmap_next_zero Vladimir Sementsov-Ogievskiy
2018-09-07 21:49   ` John Snow
2018-09-10 14:59     ` Eric Blake
2018-09-10 15:49       ` John Snow
2018-09-10 16:49     ` Vladimir Sementsov-Ogievskiy
2018-09-10 16:55       ` Eric Blake
2018-09-10 17:00         ` Vladimir Sementsov-Ogievskiy [this message]
2018-09-14 17:39           ` John Snow
2018-09-14 17:51             ` Vladimir Sementsov-Ogievskiy
2018-09-14 17:52               ` John Snow
2018-09-14 20:03               ` John Snow
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 2/8] tests: add tests for hbitmap_next_zero with specified end parameter Vladimir Sementsov-Ogievskiy
2018-09-07 21:55   ` John Snow
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 3/8] dirty-bitmap: add bdrv_dirty_bitmap_next_dirty_area Vladimir Sementsov-Ogievskiy
2018-09-10 20:42   ` John Snow
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 4/8] tests: add tests for hbitmap_next_dirty_area Vladimir Sementsov-Ogievskiy
2018-09-10 20:45   ` John Snow
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 5/8] block/mirror: fix and improve do_sync_target_write Vladimir Sementsov-Ogievskiy
2018-09-10 20:51   ` John Snow
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 6/8] Revert "block/dirty-bitmap: Add bdrv_dirty_iter_next_area" Vladimir Sementsov-Ogievskiy
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 7/8] Revert "test-hbitmap: Add non-advancing iter_next tests" Vladimir Sementsov-Ogievskiy
2018-08-14 12:14 ` [Qemu-devel] [PATCH v3 8/8] Revert "hbitmap: Add @advance param to hbitmap_iter_next()" Vladimir Sementsov-Ogievskiy
2018-09-10 20:53   ` John Snow
2018-08-16  7:35 ` [Qemu-devel] [PATCH v3 0/8] dirty-bitmap: rewrite bdrv_dirty_iter_next_area no-reply

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=0f8ecd93-3320-99aa-44aa-c8b11717c784@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.