Linux-FPGA Archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Yicong Yang <yangyicong@huawei.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Will Deacon <will@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org,
	yangyicong@hisilicon.com, linuxarm@huawei.com,
	Dan Williams <dan.j.williams@intel.com>,
	Shaokun Zhang <zhangshaokun@hisilicon.com>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>,
	Khuong Dinh <khuong@os.amperecomputing.com>,
	Robert Richter <rric@kernel.org>,
	Atish Patra <atishp@atishpatra.org>,
	Anup Patel <anup@brainfault.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Frank Li <Frank.li@nxp.com>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Vineet Gupta <vgupta@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Dave Jiang <dave.jiang@intel.com>, Wu Hao <hao.wu@intel.com>,
	Tom Rix <trix@redhat.com>,
	linux-fpga@vger.kernel.org,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Liang Kan <kan.liang@linux.intel.com>
Subject: Re: [PATCH 01/32] perf: Allow a PMU to have a parent
Date: Wed, 7 Jun 2023 12:00:48 +0100	[thread overview]
Message-ID: <d275f8af-a422-dd56-dc7d-931ac22e7f5b@arm.com> (raw)
In-Reply-To: <20230606134816.GF905437@hirez.programming.kicks-ass.net>

On 2023-06-06 14:48, Peter Zijlstra wrote:
> On Tue, Jun 06, 2023 at 02:30:52PM +0100, Mark Rutland wrote:
> 
>>>> Uh, *which* CPU device? Do we have a container device for all CPUs?
>>>
>>> drivers/base/cpu.c:per_cpu(cpu_sys_devices, cpu) for whatever the core
>>> pmu is for that cpu ?
>>
>> ... but the struct pmu covers several CPUs, so I don't have a single 'cpu', no?
>>
>> If I have a system where cpu{0,1,2} are Cortex-A53 and cpu{3,4} are Cortex-A57,
>> I have two struct pmu instances, each associated with several CPUs. When I
>> probe each of those I determine a cpumask for each.
> 
> Bah :/ Clearly I overlooked the disparity there.
> 
>>>>>> My overall favorite is an l2 cache related PMU that is spun up in
>>>>>> arch/arm/kernel/irq.c init_IRQ()
>>>>
>>>> That's an artifact of the L2 cache controller driver getting initialized there;
>>>> ideally we'd have a device for the L2 cache itself (which presumably should
>>>> hang off an aggregate CPU device).
>>>
>>> /sys/devices/system/cpu/cpuN/cache/indexM
>>>
>>> has a struct device somewhere in
>>> drivers/base/cacheinfo.c:ci_index_dev or somesuch.
>>
>> I guess, but I don't think the L2 cache controller (the PL310) is actually tied
>> to that today.
> 
> All it would do is make fancy links in sysfs I think, who cares ;-)
> 
>>>>> Yeah, we're going to have a ton of them as well. Some of them are PCI
>>>>> devices and have a clear parent, others, not so much :/
>>>>
>>>> In a number of places the only thing we have is the PMU driver, and we don't
>>>> have a driver (or device) for the HW block it's a part of. Largely that's
>>>> interconnect PMUs; we could create container devices there.
>>>
>>> Dont they have a PCI device? But yeah, some are going to be a wee bit
>>> challenging.
>>
>> The system might not even have PCI, so it's arguable that they should just hang
>> off an MMIO bus (which is effectively what the platofrm bus is).
> 
> You and your dodgy platforms :-)

For system PMUs we'll pretty much always have a platform device 
corresponding to a DT/ACPI entry used to describe MMIO registers and/or 
interrupts. In many cases the PMU is going to be the only part of the 
underlying device that is meaningful to Linux anyway, so I don't see any 
issue with just hanging the PMU device off its corresponding platform 
device - it still gives the user a way to map a PMU instance back to 
some understandable system topology (i.e. ACPI/DT) to disambiguate, and 
that's the most important thing.

Thanks,
Robin.

  reply	other threads:[~2023-06-07 11:05 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 13:41 [PATCH 00/32] Add parents to struct pmu -> dev Jonathan Cameron
2023-04-04 13:41 ` [PATCH 01/32] perf: Allow a PMU to have a parent Jonathan Cameron
2023-04-04 13:51   ` Greg KH
2023-04-06  4:03   ` Yicong Yang
2023-04-06 10:16     ` Jonathan Cameron
2023-04-06 12:40       ` Peter Zijlstra
2023-04-06 16:44         ` Jonathan Cameron
2023-04-06 17:08           ` Greg KH
2023-04-12  9:56             ` Jonathan Cameron
2023-04-06 19:49           ` Peter Zijlstra
2023-06-06 13:06             ` Mark Rutland
2023-06-06 13:18               ` Peter Zijlstra
2023-06-06 13:30                 ` Mark Rutland
2023-06-06 13:48                   ` Peter Zijlstra
2023-06-07 11:00                     ` Robin Murphy [this message]
2023-04-12 12:41           ` Robin Murphy
2023-04-04 13:41 ` [PATCH 02/32] perf/hisi-pcie: Assign parent for event_source device Jonathan Cameron
2023-04-04 13:51   ` Greg KH
2023-04-06  3:56   ` Yicong Yang
2023-04-04 13:41 ` [PATCH 03/32] Documentation: hisi-pmu: Drop reference to /sys/devices path Jonathan Cameron
2023-04-04 13:52   ` Greg KH
2023-04-06  3:56   ` Yicong Yang
2023-04-04 13:41 ` [PATCH 04/32] perf/hisi-uncore: Assign parents for event_source devices Jonathan Cameron
2023-04-04 13:52   ` Greg KH
2023-04-06  3:57   ` Yicong Yang
2023-04-04 13:41 ` [PATCH 05/32] Documentation: hns-pmu: Use /sys/bus/event_source/devices paths Jonathan Cameron
2023-04-04 13:52   ` Greg KH
2023-04-04 13:41 ` [PATCH 06/32] perf/hisi-hns3: Assign parents for event_source device Jonathan Cameron
2023-04-04 13:42 ` [PATCH 07/32] perf/amlogic: Assign parents for event_source devices Jonathan Cameron
2023-04-10  2:00   ` Jiucheng Xu
2023-04-04 13:42 ` [PATCH 08/32] perf/arm_cspmu: " Jonathan Cameron
2023-04-04 14:50   ` Suzuki K Poulose
2023-04-04 13:42 ` [PATCH 09/32] Documentation: xgene-pmu: Use /sys/bus/event_source/devices paths Jonathan Cameron
2023-04-04 13:42 ` [PATCH 10/32] perf/xgene: Assign parents for event_source devices Jonathan Cameron
2023-04-04 13:42 ` [PATCH 11/32] Documentation: thunderx2-pmu: Use /sys/bus/event_source/devices paths Jonathan Cameron
2023-04-04 13:42 ` [PATCH 12/32] perf/thunderx2: Assign parents for event_source devices Jonathan Cameron
2023-04-04 13:42 ` [PATCH 13/32] perf/riscv: " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 14/32] Documentation: qcom-pmu: Use /sys/bus/event_source/devices paths Jonathan Cameron
2023-04-04 13:42 ` [PATCH 15/32] perf/qcom: Assign parents for event_source devices Jonathan Cameron
2023-04-04 13:42 ` [PATCH 16/32] perf/imx_ddr: " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 17/32] perf/arm_pmu: " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 18/32] perf/alibaba_uncore: Assign parents for event_source device Jonathan Cameron
2023-04-05  3:50   ` Shuai Xue
2023-04-04 13:42 ` [PATCH 19/32] perf/arm-cci: " Jonathan Cameron
2023-04-04 14:45   ` Suzuki K Poulose
2023-04-04 13:42 ` [PATCH 20/32] perf/arm-ccn: " Jonathan Cameron
2023-04-12 12:09   ` Suzuki K Poulose
2023-04-04 13:42 ` [PATCH 21/32] perf/arm-cmn: " Jonathan Cameron
2023-04-12 11:52   ` Robin Murphy
2023-04-04 13:42 ` [PATCH 22/32] perf/arm-dmc620: " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 23/32] perf/arm-dsu: " Jonathan Cameron
2023-04-04 14:52   ` Suzuki K Poulose
2023-04-04 13:42 ` [PATCH 24/32] perf/arm-smmuv3: " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 25/32] perf/arm-spe: " Jonathan Cameron
2023-04-12 12:08   ` Suzuki K Poulose
2023-04-04 13:42 ` [PATCH 26/32] arc: Assign parents for event_source devices Jonathan Cameron
2023-04-04 13:42 ` [PATCH 27/32] ARM: imx: Assign parents for mmdc " Jonathan Cameron
2023-04-04 13:42 ` [PATCH 28/32] dmaengine: idxd: Assign parent for event_source device Jonathan Cameron
2023-04-04 13:42 ` [PATCH 29/32] fpga: dfl: " Jonathan Cameron
2023-04-07  6:42   ` Xu Yilun
2023-04-04 13:42 ` [PATCH 30/32] drivers/nvdimm: " Jonathan Cameron
2023-04-05  5:05   ` Dan Williams
2023-04-04 13:42 ` [PATCH 31/32] Documentation: ABI + trace: hisi_ptt: update paths to bus/event_source Jonathan Cameron
2023-04-06  3:54   ` Yicong Yang
2023-04-04 13:42 ` [PATCH 32/32] hwtracing: hisi_ptt: Assign parent for event_source device Jonathan Cameron
2023-04-06  3:55   ` Yicong Yang
2023-04-04 13:51 ` [PATCH 00/32] Add parents to struct pmu -> dev Greg KH
2023-04-04 14:40 ` Greg KH

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=d275f8af-a422-dd56-dc7d-931ac22e7f5b@arm.com \
    --to=robin.murphy@arm.com \
    --cc=Frank.li@nxp.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=acme@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=anup@brainfault.org \
    --cc=atishp@atishpatra.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hao.wu@intel.com \
    --cc=jiucheng.xu@amlogic.com \
    --cc=kan.liang@linux.intel.com \
    --cc=khuong@os.amperecomputing.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rric@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=trix@redhat.com \
    --cc=vgupta@kernel.org \
    --cc=will@kernel.org \
    --cc=xueshuai@linux.alibaba.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.com \
    --cc=zhangshaokun@hisilicon.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).