[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 20:37, Julien Grall <julien.grall@xxxxxxxxxx> wrote: > > > On 20/08/14 01:14, Anup Patel wrote: >>> >>> 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 > > > The GIC documentation says: > "If this field is 0x00 when TargetListFilter is 0b00 , the Distributor does > not forward the interrupt to any > CPU interface." > > TargetListFilter == 0b00 => Forward interrupt to a specific list of CPUs. > > >>> >>> 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 ?? > > > cpumask_weight contains a loop and multiple addition. I doubt the case where > the mask only contains the current cpu happens often. > > As the GIC won't forward the interrupt if the list of CPUs is empty, I don't > think it's worth to add this check. > > >> Other alternative is to use "cpumask_first(&target_mask) != NR_CPUS". > > > The best alternative would be cpumask_empty. All three cpumask_empty(), cpumask_first(), and cpumask_weight() are O(N) where N is number of bits in cpumask. It really does not make much difference which of these operation is chosen. Since empty target list is fine with GIC Distributor, I will drop the check. -- Anup > > Regards, > > -- > Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |