On 05/07/2024 12:16, Michael Paquier wrote:
> On Mon, Jun 10, 2024 at 03:10:33PM +0900, Michael Paquier wrote:
>> OK, cool. I'll try to get that into the tree once v18 opens up.
>
> And I've spent more time on this one, and applied it to v18 after some
> slight tweaks.
If you do:
INJECTION_POINT_LOAD(foo);
START_CRIT_SECTION();
INJECTION_POINT(foo);
END_CRIT_SECTION();
And the injection point is attached in between the
INJECTION_POINT_LOAD() and INJECTION_POINT() calls, you will still get
an assertion failure. For a testing facility, maybe that's acceptable,
but it could be fixed pretty easily.
I propose we introduce an INJECTION_POINT_CACHED(name) macro that *only*
uses the local cache. We could then also add an assertion in
InjectionPointRun() to check that it's not used in a critical section,
to enforce correct usage.
--
Heikki Linnakangas
Neon (https://neon.tech)