x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself
authorWei Liu <wei.liu@kernel.org>
Fri, 10 Sep 2021 18:57:14 +0000 (18:57 +0000)
committerWei Liu <wei.liu@kernel.org>
Sat, 11 Sep 2021 15:41:00 +0000 (15:41 +0000)
commitdfb5c1e12c28e35e4d4e5bc8022b0e9d585b89a7
tree684e75f9adcb29d7e2e1a357841ee6babe9373a0
parent7ad9bb9d0f357dcab5eb9a0f28d1c8983c48434c
x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself

It is not a good practice to allocate a cpumask on stack, given it may
consume up to 1 kilobytes of stack space if the kernel is configured to
have 8192 cpus.

The internal helper functions __send_ipi_mask{,_ex} need to loop over
the provided mask anyway, so it is not too difficult to skip `self'
there. We can thus do away with the on-stack cpumask in
hv_send_ipi_mask_allbutself.

Adjust call sites of __send_ipi_mask as needed.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Suggested-by: Michael Kelley <mikelley@microsoft.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixes: 68bb7bfb7985d ("X86/Hyper-V: Enable IPI enlightenments")
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210910185714.299411-3-wei.liu@kernel.org
arch/x86/hyperv/hv_apic.c