Linux Perf Users
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] x86/events/amd/iommu: Fix cpumask of IOMMU events
Date: Tue, 19 May 2026 13:30:12 +0530	[thread overview]
Message-ID: <005aa032-e1a0-4301-87e9-f28608c09332@amd.com> (raw)
In-Reply-To: <20260517121248.0E501C2BCB0@smtp.kernel.org>



On 5/17/2026 5:42 PM, sashiko-bot@kernel.org wrote:

> 
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] PMU initialization fails for IOMMUs located on NUMA nodes without online CPUs.
> --
> 

Thanks for the review.

> commit ef1363d0a37870d7cf1f1095cd3ebf42cc5a8bdc
> Author: Vasant Hegde <vasant.hegde@amd.com>
> 
> x86/events/amd/iommu: Fix cpumask of IOMMU events
> 
> This commit changes the IOMMU PMU cpumask from a single global mask to a
> per-IOMMU mask based on the NUMA node of the IOMMU, allowing per-socket
> performance counter collection.
> 
>> diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
>> --- a/arch/x86/events/amd/iommu.c
>> +++ b/arch/x86/events/amd/iommu.c
> [ ... ]
>> @@ -440,6 +445,20 @@ static __init int init_one_iommu(unsigned int idx)
>>               return -EINVAL;
>>       }
>>
>> +     dev = amd_iommu_idx_to_dev(idx);
>> +     node = dev ? dev_to_node(dev) : NUMA_NO_NODE;
>> +     if (node != NUMA_NO_NODE)
>> +             cpu = cpumask_any_and(cpumask_of_node(node), cpu_online_mask);
> 
> If the IOMMU resides on a CPU-less NUMA node (like a PCIe expansion switch
> or a memory-only CXL node), or if all CPUs on that node are currently
> offline, will cpumask_any_and() return a value greater than or equal to
> nr_cpu_ids?

If its CPU-less then put it back to CPU 0? Any suggestions ?

-Vasant


  parent reply	other threads:[~2026-05-19  8:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-17 11:40 [PATCH] x86/events/amd/iommu: Fix cpumask of IOMMU events Vasant Hegde
2026-05-17 12:12 ` sashiko-bot
2026-05-18 17:58   ` Chun-Tse Shao
2026-05-19  8:00   ` Vasant Hegde [this message]
2026-05-28  7:28 ` Jörg Rödel
2026-05-29  6:58 ` Sandipan Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=005aa032-e1a0-4301-87e9-f28608c09332@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox