qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, Wen Congyang <wency@cn.fujitsu.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	vsementsov@virtuozzo.com, qemu-block@nongnu.org,
	Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, mreitz@redhat.com, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"
Date: Mon, 23 Nov 2015 15:49:58 +0100	[thread overview]
Message-ID: <56532796.6000702@redhat.com> (raw)
In-Reply-To: <20151123095506.GC689@ad.usersys.redhat.com>



On 23/11/2015 10:55, Fam Zheng wrote:
>>> Why? I think bitmap_set is a better match with bitmap_new below.
>>
>> set_bit() is quicker than bitmap_set() if you only set one bit.
> 
> How much quicker is it? This doesn't sound convincing enough for me to lose the
> readability.

Substantially.  It's also documented:

/*
 * Also the following operations apply to bitmaps.
 *
 * set_bit(bit, addr)                   *addr |= bit
 * clear_bit(bit, addr)                 *addr &= ~bit
 * change_bit(bit, addr)                *addr ^= bit
 * test_bit(bit, addr)                  Is bit set in *addr?
 * test_and_set_bit(bit, addr)          Set bit and return old value
 * test_and_clear_bit(bit, addr)        Clear bit and return old value
 * test_and_change_bit(bit, addr)       Change bit and return old value
 * find_first_zero_bit(addr, nbits)     Position first zero bit in *addr
 * find_first_bit(addr, nbits)          Position first set bit in *addr
 * find_next_zero_bit(addr, nbits, bit) Position next zero bit in *addr >= bit
 * find_next_bit(addr, nbits, bit)      Position next set bit in *addr >= bit
 */

Paolo

  parent reply	other threads:[~2015-11-23 14:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  9:59 [Qemu-devel] [PATCH for 2.6 0/3] Bitmap clean-up patches for 2.6 Fam Zheng
2015-11-20  9:59 ` [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap" Fam Zheng
2015-11-20 15:53   ` Vladimir Sementsov-Ogievskiy
2015-11-23  6:42     ` Fam Zheng
2015-11-23  9:01   ` Wen Congyang
2015-11-23  9:19     ` Fam Zheng
2015-11-23  9:24       ` Wen Congyang
2015-11-23  9:55         ` Fam Zheng
2015-11-23  9:58           ` Wen Congyang
2015-11-23 14:49           ` Paolo Bonzini [this message]
2015-11-23 21:00   ` John Snow
2015-11-20  9:59 ` [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface Fam Zheng
2015-11-20 16:08   ` Vladimir Sementsov-Ogievskiy
2015-11-23  6:44     ` Fam Zheng
2015-11-23 21:34   ` John Snow
2015-11-24  2:28     ` Fam Zheng
2015-11-24  9:12       ` Vladimir Sementsov-Ogievskiy
2015-11-25  2:49         ` Fam Zheng
2015-11-24 19:19       ` John Snow
2015-11-20  9:59 ` [Qemu-devel] [PATCH for 2.6 3/3] hbitmap: Drop "granularity" Fam Zheng
2015-11-20 16:22   ` Vladimir Sementsov-Ogievskiy
2015-11-23  6:46     ` Fam Zheng
2015-11-20 16:42 ` [Qemu-devel] [PATCH for 2.6 0/3] Bitmap clean-up patches for 2.6 Vladimir Sementsov-Ogievskiy

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=56532796.6000702@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    --cc=wency@cn.fujitsu.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).