Re: URCU feature request?

Olivier Dion via lttng-dev <[email protected]> Fri, 05 Sep 2025 14:04:21 -0400
Newsgroups org.lttng.lists.lttng-dev
Organization EfficiOS
Message-ID <87h5xg7p3u.fsf@laura>
On Thu, 04 Sep 2025, Thobias Knudsen <[email protected]> wrote:
>> I am confuse about the overall discussion here.  Are we talking about
>> static checking of RCU pointers usage or runtime checking?
>>
>> Is is possible to see the implementation you made so I can understand
>> better?
>
> Sorry for being late to answer :/
> The library overrides a subset of urcu and lfht functions with macros and
> replaces them with other functions which checks in runtime if the functio=
ns
> are called in the correct order.
> here is the code: https://github.com/ThobiasKnudsen/urcu_lfht_safe

It looks like you want runtime verification for the usage of the API.
Did you know that URCU can now be compiled against ThreadSanitizer
(TSAN)?  If a user misuses the API or makes incorrect assumptions about
the guarantees offered by RCU, TSAN will most likely detect those
issues.  Coupled with the other debug features we already have, this
makes it very hard to not trigger an error path when the API is used
incorrectly.

Note that certain kind of errors could actually be flag at compile time
with the proper tooling.  For example, the Linux kernel uses a `__rcu'
attribute that Sparse can understand to flag improper use of
RCU=E2=80=91protected pointers.  I=E2=80=99d be very open to exposing somet=
hing similar
(an attribute) for static checkers.

[...]

Thanks,
Olivier
--=20
Olivier Dion
EfficiOS Inc.
https://www.efficios.com