Skip to content

Commit 1f8986f

Browse files
Shrikanth Hegdemaddy-kerneldev
authored andcommitted
powerpc/perf: Use cpumask_intersects api for checking disable path
First online CPU in the node disables the nest counters by making an OPAL call. Any other CPU in that node, will bail out. Instead of using a temporary mask to find out if any cpu in the node is visited or not, it is better to use the cpumask_intersects api to achieve the same. Similarly a temporary cpumask is used to check if a core is already part of core_imc_cpumask. Use the same cpumask_intersects api there. Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Yury Norov <ynorov@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260427044715.559137-4-sshegde@linux.ibm.com
1 parent a66eab7 commit 1f8986f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

arch/powerpc/perf/imc-pmu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ static int ppc_nest_imc_cpu_offline(unsigned int cpu)
421421
static int ppc_nest_imc_cpu_online(unsigned int cpu)
422422
{
423423
const struct cpumask *l_cpumask;
424-
static struct cpumask tmp_mask;
425424
int res;
426425

427426
/* Get the cpumask of this node */
@@ -431,7 +430,7 @@ static int ppc_nest_imc_cpu_online(unsigned int cpu)
431430
* If this is not the first online CPU on this node, then
432431
* just return.
433432
*/
434-
if (cpumask_and(&tmp_mask, l_cpumask, &nest_imc_cpumask))
433+
if (cpumask_intersects(l_cpumask, &nest_imc_cpumask))
435434
return 0;
436435

437436
/*
@@ -647,14 +646,13 @@ static bool is_core_imc_mem_inited(int cpu)
647646
static int ppc_core_imc_cpu_online(unsigned int cpu)
648647
{
649648
const struct cpumask *l_cpumask;
650-
static struct cpumask tmp_mask;
651649
int ret = 0;
652650

653651
/* Get the cpumask for this core */
654652
l_cpumask = cpu_sibling_mask(cpu);
655653

656654
/* If a cpu for this core is already set, then, don't do anything */
657-
if (cpumask_and(&tmp_mask, l_cpumask, &core_imc_cpumask))
655+
if (cpumask_intersects(l_cpumask, &core_imc_cpumask))
658656
return 0;
659657

660658
if (!is_core_imc_mem_inited(cpu)) {

0 commit comments

Comments
 (0)