|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 4/7] x86: add support for COS/CBM manangement
>>> On 23.03.15 at 09:47, <chao.p.peng@xxxxxxxxxxxxxxx> wrote:
> On Fri, Mar 20, 2015 at 05:13:44PM +0000, Jan Beulich wrote:
>> >>> On 19.03.15 at 11:41, <chao.p.peng@xxxxxxxxxxxxxxx> wrote:
>> > +static unsigned int get_socket_cpu(unsigned int socket)
>> > +{
>> > + unsigned int cpu;
>> > +
>> > + for_each_online_cpu ( cpu )
>> > + if ( cpu_to_socket(cpu) == socket )
>> > + return cpu;
>> > + return nr_cpu_ids;
>> > +}
>>
>> This can be a rather long loop for a huge system. I think you need to
>> find some better solution for this.
>
> Maintain a socket_cpu_map for each socket? Sounds no existed way.
Perhaps your per-socket data structure could store a pointer to
a suitable cpu_sibling_mask instance (and then the function above
could simply be cpumask_any() on that mask). Of course it'll need
updating when the owning CPU goes down, but thanks to you
having the very sibling mask in your hands at that point, finding
a replacement should be trivial.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |