Re: [PATCH 09/10] nodeinfo: Use a bitmap to keep track of node CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2015-07-20 at 15:47 +0200, Peter Krempa wrote:
> 
> > +    /* Iterate over all CPUs in the node, in ascending order */
> > +    for (cpu = 0; cpu < npresent_cpus; cpu++) {
> >  
> > -        if (!virBitmapIsBitSet(present_cpumap, cpu))
> > +        /* Skip CPUs that are not part of the current node */
> > +        if (!virBitmapIsBitSet(node_cpus_map, cpu))
> 
> Perhaps you can use virBitmapNextSetBit to simplify the iteration.
> 
> >              continue;
> >  
> >          if (!virBitmapIsBitSet(online_cpus_map, cpu)) {
> 
> ACK with or without the iteration modified.

I tried following your suggestion but I didn't like the
result very much, so I've left the loop as-is in v2.

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]