From: Dario Faggioli <dario.faggioli@citrix.com>
To: "lindaj@jma3.com" <lindaj@jma3.com>
Cc: Julien Grall <julien.grall@citrix.com>,
"lars.kurth@xen.org" <lars.kurth@xen.org>,
Wei Liu <wei.liu2@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxl new bitmap functions
Date: Fri, 3 Apr 2015 14:34:49 +0000 [thread overview]
Message-ID: <1428071687.7917.24.camel@citrix.com> (raw)
In-Reply-To: <551E9A31.9050105@jma3.com>
[-- Attachment #1.1: Type: text/plain, Size: 2483 bytes --]
On Fri, 2015-04-03 at 07:48 -0600, Linda wrote:
> Dario,
>
Hi,
One thing: here in the ML, please, don't top post.
> I like your comments on naming. We'll see what others say.
> As far as difference, at least as I've implemented it, it's the
> exclusive or.
>
Well, then I'd call it libxl_bitmap_xor(). :-)
BTW, is there an actual use case for it? Intersection and union, I'm
sure they can be useful in many places (I know it from my direct
experience!)... xor, not sure I ever needed it. I'm not complaining or
objecting, I'm just asking. :-D
> To all,
> I've been thinking about Konrad's comment that we should disallow
> bitmaps of unequal size, in the XOR/difference function. I've
> implemented it, so the resulting bitmap is the size of the larger input
> bitmap, and the bits past the end of the smaller bitmap are all ones. I
> think this is inelegant.
>
I don't like this either.
> Another possibility, is, if two bitmaps are of unequal size, make
> the XOR bitmap be the size of the smaller bitmap. This would actually
> yield a reasonable result.
> What do others say?
>
I'm really not sure. This certainly looks at least better than the
solution above, IMO. Another thing that you could do to actually
disallow this is to just return an error if you detect the two bitmaps
have different sizes, but again, I'm not sure... let's see what Wei and
other libxl maintainers (which I'm Cc-ing) think.
Regards,
Dario
> Thanks.
>
> Linda Jacobson
>
>
> On 4/3/2015 3:25 AM, Dario Faggioli wrote:
> > On Thu, 2015-04-02 at 11:38 -0600, Linda Jacobson wrote:
> >> From: Linda <lindaj@jma3.com>
> >>
> >> Added bitmap functions for union intersection and difference betweenn two bitmaps
> >>
> > Just wondering, about union and intersection, are them the best names
> > for these operations, or do we want libxl_bitmap_or() and
> > libxl_bitmap_and()? Personally, I'd go for _and() and _or(), it's more
> > common and more consistent with what we have already in the codebase.
> >
> > About difference, what it the exact intended semantic of that operation?
> > In set theory, AFAICR, A-B is the set of elements that are in A and are
> > not in B. For a binary bitmap, I'd say it is the set of bits that are
> > set in A and are not set in B, is it so? Whatever it is, we should write
> > it down somewhere, e.g., in libxl_utils.h, as the function's doc
> > comment.
> >
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-04-03 14:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 17:38 [PATCH] tools/libxl new bitmap functions Linda Jacobson
2015-04-02 19:34 ` Konrad Rzeszutek Wilk
2015-04-03 14:37 ` Dario Faggioli
2015-04-07 15:45 ` Linda
2015-04-07 15:51 ` Julien Grall
2015-04-03 9:25 ` Dario Faggioli
2015-04-03 13:48 ` Linda
2015-04-03 14:34 ` Dario Faggioli [this message]
2015-04-07 10:54 ` Wei Liu
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=1428071687.7917.24.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=julien.grall@citrix.com \
--cc=lars.kurth@xen.org \
--cc=lindaj@jma3.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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.