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

Re: [Xen-devel] [PATCH] xen/arm: minor improvement in smp_send_call_function_mask()



On 20 August 2014 02:36, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> Hi Anup,
>
>
> On 18/08/14 23:48, Anup Patel wrote:
>>
>>   xen/arch/arm/smp.c |   14 +++++++++++++-
>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
>> index 30203b8..c80c068 100644
>> --- a/xen/arch/arm/smp.c
>> +++ b/xen/arch/arm/smp.c
>> @@ -19,7 +19,19 @@ void smp_send_event_check_mask(const cpumask_t *mask)
>>
>>   void smp_send_call_function_mask(const cpumask_t *mask)
>>   {
>> -    send_SGI_mask(mask, GIC_SGI_CALL_FUNCTION);
>> +    cpumask_t target_mask;
>> +
>> +    cpumask_andnot(&target_mask, mask, cpumask_of(smp_processor_id()));
>> +
>> +    if ( cpumask_weight(&target_mask) )
>
>
> Is it necessary? What happen if Xen tries to send an SGI with an empty mask?

If Xen tries to send SGI with empty mask then target_mask will be empty
hence cpumask_weight(&target_mask) will return 0

>
> AFAIU, the function cpumask_weight is complex so if we can avoid it, it
> would be better.

Can you explain more about how cpumask_weight is complex ??

Other alternative is to use "cpumask_first(&target_mask) != NR_CPUS".

>
> --
> Julien Grall

--
Anup

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.