From: "Yoshihiro Furudera (Fujitsu)" <fj5100bi@fujitsu.com>
To: 'Jonathan Cameron' <Jonathan.Cameron@huawei.com>
Cc: "'Will Deacon'" <will@kernel.org>,
"'Mark Rutland'" <mark.rutland@arm.com>,
"'Jonathan Corbet'" <corbet@lwn.net>,
"'Catalin Marinas'" <catalin.marinas@arm.com>,
"'linux-arm-kernel@lists.infradead.org'"
<linux-arm-kernel@lists.infradead.org>,
"'Bjorn Andersson'" <quic_bjorande@quicinc.com>,
"'Geert Uytterhoeven'" <geert+renesas@glider.be>,
"'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
"'Dmitry Baryshkov'" <dmitry.baryshkov@linaro.org>,
"'Konrad Dybcio'" <konradybcio@kernel.org>,
"'Neil Armstrong'" <neil.armstrong@linaro.org>,
"'Arnd Bergmann'" <arnd@arndb.de>,
"' Nícolas \"F. R. A. Prado\"'" <nfraprado@collabora.com>,
"'Thomas Gleixner'" <tglx@linutronix.de>,
"'Peter Zijlstra'" <peterz@infradead.org>,
"'linux-doc@vger.kernel.org'" <linux-doc@vger.kernel.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 1/2] perf: Fujitsu: Add the Uncore MAC PMU driver
Date: Wed, 25 Dec 2024 08:07:25 +0000 [thread overview]
Message-ID: <OS3PR01MB6903C0DAEAAC66FB86AAAC1FD40C2@OS3PR01MB6903.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <OS3PR01MB69035A6B5F695F039B5D77C3D4062@OS3PR01MB6903.jpnprd01.prod.outlook.com>
Hi, Jonathan
> > > +static ssize_t cpumask_show(struct device *dev,
> > > + struct device_attribute *attr, char *buf) {
> > > + struct mac_pmu *macpmu = to_mac_pmu(dev_get_drvdata(dev));
> > If as suggested below you used an index to store the cpu rather than a
> > one hot mask, you'd need to create the mask here to print it.
>
> I'll use the CPU index.
> So I will create a mask and print it.
>
> > > +
> > > + return cpumap_print_to_pagebuf(true, buf, &macpmu->cpumask); }
> >
> > ...
> >
> > > +static int fujitsu_mac_pmu_online_cpu(unsigned int cpu, struct
> > > +hlist_node *node) {
> > > + struct mac_pmu *macpmu = hlist_entry_safe(node, struct mac_pmu,
> > > +node);
> > > +
> > > + /* If there is not a CPU/PMU association pick this CPU */
> > > + if (cpumask_empty(&macpmu->cpumask))
> > > + cpumask_set_cpu(cpu, &macpmu->cpumask);
> > As below. Seems like just storing the CPU index (and using -1 for not
> > yet
> > set) would be simpler than
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int fujitsu_mac_pmu_offline_cpu(unsigned int cpu, struct
> > > +hlist_node *node) {
> > > + struct mac_pmu *macpmu = hlist_entry_safe(node, struct mac_pmu,
> > node);
> > > + unsigned int target;
> > > +
> > > + if (!cpumask_test_and_clear_cpu(cpu, &macpmu->cpumask))
> >
> > If you are only ever going to set one bit in the mask, why not just
> > store the CPU index instead?
>
> I'll use the CPU index instead.
Sorry, I considered using the CPU index, but while implementing, I realized that
using cpumask makes the process simpler. Therefore, I would like to keep it as it is.
Best Regards,
Yoshihiro Furudera
next prev parent reply other threads:[~2024-12-25 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 6:17 [PATCH v2 0/2] perf: Fujitsu: Add Uncore MAC/PCI " Yoshihiro Furudera
2024-11-22 6:17 ` [PATCH v2 1/2] perf: Fujitsu: Add the Uncore MAC " Yoshihiro Furudera
2024-12-11 11:39 ` Jonathan Cameron
2024-12-19 2:27 ` Yoshihiro Furudera (Fujitsu)
2024-12-20 2:26 ` Yoshihiro Furudera (Fujitsu)
2024-12-25 8:07 ` Yoshihiro Furudera (Fujitsu) [this message]
2024-11-22 6:17 ` [PATCH v2 2/2] perf: Fujitsu: Add the Uncore PCI " Yoshihiro Furudera
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=OS3PR01MB6903C0DAEAAC66FB86AAAC1FD40C2@OS3PR01MB6903.jpnprd01.prod.outlook.com \
--to=fj5100bi@fujitsu.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=dmitry.baryshkov@linaro.org \
--cc=geert+renesas@glider.be \
--cc=konradybcio@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=neil.armstrong@linaro.org \
--cc=nfraprado@collabora.com \
--cc=peterz@infradead.org \
--cc=quic_bjorande@quicinc.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®