Re: [PATCH/RFC] lib: add CPU MHz benchmark test
From: Willy Tarreau
Date: Sun Feb 11 2024 - 06:17:55 EST
Hi Geert!
On Thu, Feb 01, 2024 at 09:49:33AM +0100, Geert Uytterhoeven wrote:
> > > Parallel runs (run on multiple CPU cores) are supported, just kick the
> > > "run" file multiple times.
> >
> > Hmmm does it mean it will run on the CPU that writes this "run" ?
> > Because this could allow one to start tests using e.g.:
> >
> > taskset -c $CPU tee /sys/.../run <<< y
>
> That does indeed work.
OK!
> > But we could also wonder if it wouldn't be easier to either send "y"
> > to /sys/.../cpu0/run or may just send the CPU number to "run" instead
> > of "y".
>
> That would complicate the code a lot.
OK I trust you, I was merely asking just in case.
> > In my experience with this tool, you most always want to easily
> > control the CPU number because SoCs these days are not symmetrical at
> > all.
>
> That's why it prints the CPU number ;-)
>
> On multi-core systems, you can also do e.g.
>
> for i in $(seq $(nproc)); do echo yes >
> /sys/module/test_mhz/parameters/run & done
>
> and collect the results for all CPU cores.
OK!
> BTW, this is the same for test_dhry.
I didn't know, that's an even better reason for not changing any of this!
> > Another point is that it would be nice if there was a way to present
> > the result in a form that a script can retrieve from the directory,
> > maybe the last measurement or something like this. I know that scripts
> > are commonly used to check for a machine's correct behavior, and I try
> > to encourage users to verify that it's working well, so anything we can
> > do that makes it easier to use would be welcome.
>
> I'll give that a try...
Thanks.
> > Hmmm I don't know if this is intended, the SPDX tag says MIT but the
> > MODULE_LICENSE at the top says MIT/GPL. I can't say I care that much but
> > I preferred to report it in case it's an accident ;-)
>
> That must be an oversight. I'll change the SPDX-License-Identifier to
> "GPL-2.0 OR MIT".
OK no problem!
Thanks,
Willy