Hi Krzysztof,
Thanks for your R-b.
On Wednesday, 5 November 2025 12:56:40 CET Krzysztof Karas wrote:
> Hi Janusz,
>
> [...]
>
> > > > + cpuinfo = fopen("/proc/cpuinfo", "r");
> > > > + if (igt_debug_on(!cpuinfo))
> > > > + return UINT_MAX;
> > > Could this result in running the test on a slower machine
> > > unintentionally? fopen() could fail, the bogomips() would return
> > > a large value and wrapper function would behave as if the test
> > > is running on a faster platform.
> >
> > Yes, if opening /proc/cpuinfo fails then my approach could result in
> > running
> > the test on a machine that occurs too slow. If that happens then an abort
> > caused by soft lockup will be reported again, but this time with the
> > fopen()
> > failure also pointed out among debug messages. But why could that failing
> > fopen() happen in practice?
> >
> Yeah, you are right, we do not expect this to fail.
>
> > One possible case is an environment with no /proc/cpuinfo (non-Linux, e.g.,
> > FreeBSD).
> We do not run the same code on non-Linux OSes, do we?
We don't, but others may want to do, and we are prepared for that to some
extent, see e.g. lib/igt_os.c.
Thanks,
Janusz
...