From: Dulloor <dulloor@gmail.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Jan Beulich <JBeulich@novell.com>
Subject: Re: [PATCH] libxc bitmap utils and vcpu-affinity
Date: Tue, 30 Mar 2010 12:05:37 -0400 [thread overview]
Message-ID: <940bcfd21003300905y78754e2cu101055e429a303a1@mail.gmail.com> (raw)
In-Reply-To: <C7D7D456.F136%keir.fraser@eu.citrix.com>
> No changeset comment. No signed-off-by line.
Sorry, I forgot. Will do once we finalize on the patch.
> It actually bloats the libraries by a net 650 LOC
> (747 added, 87 deleted according to diffstat).
In the patch, we have used the library only for vcpu get/set affinity.
There are clearly other opportunities (right now and in future) to use
most of the functions provided by the library, which will offset this.
Also, this provides a cleaner/standard way of using the cpumap
structure in libxc.
> And below I append the very first function I read: it doesn't inspire
> confidence that the implementation is over-complicated/long and
> unnecessarily handles 16-bit values.
I guess you mean 8-bit values. The library works with byte-based
bitmap structures, instead of "uint32_t or uint64_t" bitmap
structures, so that we don't need to convert when using the
bitmap-library with xenctl_cpumap. Please let know if you would rather
that we keep the bitmap utilities separate from xenctl_cpumap and
provide for conversion functions. That would be a small change.
The function that you quote is inspired from linux kernel
implementation (as mentioned) and is a simple generic function. And I
have tested the library thoroughly.
> Why should I show your patch some love?
We can work towards that ;)
-dulloor
On Tue, Mar 30, 2010 at 11:16 AM, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
> No changeset comment. No signed-off-by line. It actually bloats the
> libraries by a net 650 LOC (747 added, 87 deleted according to diffstat).
> And below I append the very first function I read: it doesn't inspire
> confidence that the implementation is over-complicated/long and
> unnecessarily handles 16-bit values. Why should I show your patch some love?
>
> -- Keir
>
> +static inline int __xc_ffs(uint8_t byte)
> +{
> + int num = 0;
> +
> + if ((byte & 0xff) == 0) {
> + num += 8;
> + byte >>= 8;
> + }
> + if ((byte & 0xf) == 0) {
> + num += 4;
> + byte >>= 4;
> + }
> + if ((byte & 0x3) == 0) {
> + num += 2;
> + byte >>= 2;
> + }
> + if ((byte & 0x1) == 0)
> + num += 1;
> + return num;
> +}
>
> On 30/03/2010 15:42, "Dulloor" <dulloor@gmail.com> wrote:
>
>> Resubmitting the patch.
>>
>> -dulloor
>>
>> ---------- Forwarded message ----------
>> From: Dulloor <dulloor@gmail.com>
>> Date: Tue, Mar 23, 2010 at 12:55 PM
>> Subject: Re: [Xen-devel][PATCH] libxc bitmap utils and vcpu-affinity
>> To: Keir Fraser <keir.fraser@eu.citrix.com>
>> Cc: Jan Beulich <JBeulich@novell.com>, "xen-devel@lists.xensource.com"
>> <xen-devel@lists.xensource.com>
>>
>>
>> Please use this patch, in which length of bitmap is
>> (physinfo.max_cpu_id+1), rather than (physinfo.nr_cpus).
>>
>> -dulloor
>>
>> On Tue, Mar 23, 2010 at 12:41 PM, Dulloor <dulloor@gmail.com> wrote:
>>> I meant utils for **xenctl_cpumap**
>>>
>>> On Tue, Mar 23, 2010 at 12:40 PM, Dulloor <dulloor@gmail.com> wrote:
>>>> Fine, I agree with you both. Attached is a patch adding utils for
>>>> xenctl_bitmap (to libxc) and using the same in vcpu_(get|set)affinity.
>>>> For the guest-numa interface, I will see if I can use xenctl_cpumap.
>>>>
>>>> -dulloor
>>>>
>>>> On Tue, Mar 23, 2010 at 7:05 AM, Keir Fraser <keir.fraser@eu.citrix.com>
>>>> wrote:
>>>>> On 23/03/2010 10:10, "Jan Beulich" <JBeulich@novell.com> wrote:
>>>>>
>>>>>>>>> Dulloor <dulloor@gmail.com> 22.03.10 18:44 >>>
>>>>>>> Motivation for using xenctl_cpumask in Xen interfaces :
>>>>>>> - xenctl_cpumap is just 4 bytes smaller than static xenctl_cpumask for
>>>>>>> 128 cpus (128 would be good for quite some time). However, the new
>>>>>>
>>>>>> I don't buy this (we're already building for 256 CPUs, looking forward
>>>>>> to further bump this in the not too distant future), and I'm generally
>>>>>> opposed to introducing hard coded limits in a public interface.
>>>>>
>>>>> We should use xenctl_cpumask everywhere for specifying physical CPU
>>>>> bitmaps,
>>>>> even into guest NUMA interfaces if appropriate. I don't really care if it
>>>>> is
>>>>> a bit harder to use than a static bitmap.
>>>>>
>>>>> -- Keir
>>>>>
>>>>>
>>>>>
>>>>
>>>
>
>
>
next prev parent reply other threads:[~2010-03-30 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 3:33 [PATCH] libxc bitmap utils and vcpu-affinity Dulloor
2010-03-22 7:30 ` Keir Fraser
2010-03-22 17:44 ` Dulloor
2010-03-23 10:10 ` Jan Beulich
2010-03-23 11:05 ` Keir Fraser
2010-03-23 16:40 ` Dulloor
2010-03-23 16:41 ` Dulloor
2010-03-23 16:55 ` Dulloor
2010-03-30 14:42 ` Fwd: " Dulloor
2010-03-30 15:16 ` Keir Fraser
2010-03-30 16:05 ` Dulloor [this message]
2010-03-30 16:27 ` Keir Fraser
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=940bcfd21003300905y78754e2cu101055e429a303a1@mail.gmail.com \
--to=dulloor@gmail.com \
--cc=JBeulich@novell.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.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).