[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240701142222.GA2691@willie-the-truck>
Date: Mon, 1 Jul 2024 15:22:23 +0100
From: Will Deacon <will@...nel.org>
To: Yicong Yang <yangyicong@...wei.com>
Cc: mark.rutland@....com, acme@...nel.org, namhyung@...nel.org,
linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, james.clark@....com, dongli.zhang@...cle.com,
jonathan.cameron@...wei.com, prime.zeng@...ilicon.com,
linuxarm@...wei.com, yangyicong@...ilicon.com
Subject: Re: [PATCH 0/3] Perf avoid opening events on offline CPUs
On Mon, Jun 03, 2024 at 05:28:09PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@...ilicon.com>
>
> If user doesn't specify the CPUs, perf will try to open events on CPUs
> of the PMU which is initialized from the PMU's "cpumask" or "cpus" sysfs
> attributes if provided. But we doesn't check whether the CPUs provided
> by the PMU are all online. So we may open events on offline CPUs if PMU
> driver provide offline CPUs and then we'll be rejected by the kernel:
>
> [root@...alhost yang]# echo 0 > /sys/devices/system/cpu/cpu0/online
> [root@...alhost yang]# ./perf_static stat -e armv8_pmuv3_0/cycles/ --timeout 100
> Error:
> The sys_perf_event_open() syscall returned with 19 (No such device) for event (cpu-clock).
> /bin/dmesg | grep -i perf may provide additional information.
I still don't see the value in this. CPUs can come and go asynchronously,
so this is all horribly racy. Furthermore, there are other (racy) ways
to find out which CPUs are online and whatever we do in the kernel now
isn't going to help userspace running on older kernels.
Will
Powered by blists - more mailing lists