Re: [PATCH v5 07/10] platform/x86/intel/ifs: Add scan test support

From: Luck, Tony
Date: Thu May 05 2022 - 14:39:19 EST


On Thu, May 05, 2022 at 11:01:27AM +0200, Thomas Gleixner wrote:
> On Thu, May 05 2022 at 10:28, Peter Zijlstra wrote:
> > On Thu, May 05, 2022 at 01:15:07AM +0200, Thomas Gleixner wrote:
> >> We don't have stomp_cpumask() today, but that's trivial enough to
> >> implement.
> >
> > I don't think we want to gift people a random cpumask stop_machine(),
>
> Fair enough.
>
> > but here's one that stops a core. It runs the @fn on every cpu since I
> > thought to have understood that was the requirement for this muck.
>
> Yes.
>
> > *completely* untestededed.
>
> Looks about right neverthelessesseess.

Close enough. I made these changes:

1) Added EXPORT_SYMBOL_GPL()
2) Added protoype in <linux/stop_machine.h>
3) Moved the kerneldoc comment to the header (for some reason
the other stop* functions document there).
4) Edited that kerneldoc a bit <<<< NEEDS REVIEW >>>
5) Changed a ';' to a ',' to make it compile.

With that it works, and will do exactly what I need (with less code
in the IFS driver by the look of things).

A couple of thousand tests shows it works. The two threads
arrive within 20 TSC cycles of each other 60% of the time,
but I have some outliers up to 654 cycles ... which is plenty
close enough.

Patch now looks like this. Author credit to Peter ... are you willing
to add a Signed-off-by to stop checkpatch from whining at me?

There isn't a "Something-similar-suggested-by:" tag to credit Thomas
with this. Perhaps "Inspired-by:"?

-Tony