]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Fix cpu_online_cores_map to return only online threads mask
authorShreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Mon, 20 Apr 2015 05:02:56 +0000 (10:32 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 22 May 2015 05:12:30 +0000 (15:12 +1000)
commita5e48fb3e052b75f19f16fc8dd95455455801855
treef2209845b4f66ad3301f5dad374c47fff059c9cb
parent91e444b00779fb09bb0b8329cce6d8513dfb7bbb
powerpc: Fix cpu_online_cores_map to return only online threads mask

Currently, cpu_online_cores_map returns a mask, which for every core with
at least one online thread, has the bit for thread 0 of the core set to 1,
and the bits for all other threads of the core set to 0. But thread 0 of
the core itself may not be online always. In such cases, if the returned
mask is used for IPI, then it'll cause IPIs to be skipped on cores where
the first thread is offline, because the IPI code refuses to send IPIs to
offline threads.

Fix this by setting the bit of the first online thread in the core.
This is done by fixing this in the underlying function
cpu_thread_mask_to_cores.

The result has the property that for all cores with online threads, there
is one bit set in the returned map. And further, all bits that are set in
the returned map correspond to online threads.

Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
[ Changelog from Michael Ellerman <mpe@ellerman.id.au> ]
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cputhreads.h