| #
4dd146e5 |
| 08-Sep-2023 |
Artemy Kovalyov <artemyko@nvidia.com> |
mem: annotate locks for memseg list walk
Implementing a lock annotation for rte_memseg_list_walk() to proactively identify bugs similar to memory_hotplug_lock deadlock during initialization during c
mem: annotate locks for memseg list walk
Implementing a lock annotation for rte_memseg_list_walk() to proactively identify bugs similar to memory_hotplug_lock deadlock during initialization during compile time.
Signed-off-by: Artemy Kovalyov <artemyko@nvidia.com> Acked-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| #
657a98f3 |
| 07-Feb-2023 |
David Marchand <david.marchand@redhat.com> |
eal: annotate spinlock, rwlock and seqlock
clang offers some thread safety checks, statically verifying that locks are taken and released in the code. To use those checks, the full code leading to t
eal: annotate spinlock, rwlock and seqlock
clang offers some thread safety checks, statically verifying that locks are taken and released in the code. To use those checks, the full code leading to taking or releasing locks must be annotated with some attributes.
Wrap those attributes into our own set of macros.
rwlock, seqlock and the "normal" spinlock are instrumented.
Those checks might be of interest out of DPDK, but it requires that the including application locks are annotated. On the other hand, applications out there might have been using those same checks. To be on the safe side, keep this instrumentation under a RTE_ANNOTATE_LOCKS internal build flag.
A component may en/disable this check by setting annotate_locks = true/false in its meson.build.
Note: Doxygen preprocessor does not understand trailing function attributes (this can be observed with the rte_seqlock.h header). One would think that expanding the annotation macros to a noop in rte_lock_annotations.h would be enough (since RTE_ANNOTATE_LOCKS is not set during doxygen processing)). Unfortunately, the use of EXPAND_ONLY_PREDEF defeats this.
Removing EXPAND_ONLY_PREDEF entirely is not an option as it would expand all other DPDK macros.
The chosen solution is to expand the annotation macros explicitly to a noop in PREDEFINED.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Chenbo Xia <chenbo.xia@intel.com>
show more ...
|