OSDN Git Service

cpumask: Implement cpumask_or_equal()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 22 Jul 2019 18:47:24 +0000 (20:47 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 25 Jul 2019 13:47:37 +0000 (15:47 +0200)
commitb9fa6442f7043e2cdd247905d4f3b80f2e9605cb
tree94f8a7ccb98e93e675a71730da84c8a77cf9389d
parente797bda3fd29137f6c151dfa10ea6a61c17895ce
cpumask: Implement cpumask_or_equal()

The IPI code of x86 needs to evaluate whether the target cpumask is equal
to the cpu_online_mask or equal except for the calling CPU.

To replace the current implementation which requires the usage of a
temporary cpumask, which might involve allocations, add a new function
which compares a cpumask to the result of two other cpumasks which are
or'ed together before comparison.

This allows to make the required decision in one go and the calling code
then can check for the calling CPU being set in the target mask with
cpumask_test_cpu().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20190722105220.585449120@linutronix.de
include/linux/bitmap.h
include/linux/cpumask.h
lib/bitmap.c