From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6co-0005uc-MG for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:28:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO6cc-0004Of-HO for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:28:46 -0400 Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]:49243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6cc-0004OV-Ae for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:28:34 -0400 Received: by mail-ee0-f49.google.com with SMTP id c41so447925eek.22 for ; Thu, 13 Mar 2014 07:28:33 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5321C08D.3050007@redhat.com> Date: Thu, 13 Mar 2014 15:28:29 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1394605864-32237-1-git-send-email-famz@redhat.com> <1394605864-32237-6-git-send-email-famz@redhat.com> <20140313134536.GE4534@irqsave.net> In-Reply-To: <20140313134536.GE4534@irqsave.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 5/9] hbitmap: Add hbitmap_copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Beno=EEt_Canet?= , Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 13/03/2014 14:45, Benoît Canet ha scritto: > This feel wrong: > > struct HBitmap { > /* Number of total bits in the bottom level. */ > uint64_t size; > > The comment about size imply that size apply only to the bottom level. > > Moreover the bitmaps are progressivelly less coarse so I think the size you use > should goes down as you go up to the top. Correct. You can reuse the computation in hbitmap_alloc instead. Paolo