[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/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.


Julien Grall

Xen-devel mailing list



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