[LTP] [PATCH v2 1/2] tst_atomic: drop legacy inline assembly and use __atomic or __sync builtins

Li Wang liwang@redhat.com
Fri Jun 6 11:36:00 CEST 2025


On Fri, Jun 6, 2025 at 5:18 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > Refactor tst_atomic.h to remove all legacy architecture-specific inline
> > assembly and fallback code paths. The new implementation supports only
> > two well-defined interfaces: __atomic_* built-ins (GCC ≥ 4.7) and
> __sync_*
> > built-ins (GCC ≥ 4.1).
> >
> > This simplification improves maintainability, clarity, and portability
> > across platforms. It also updates all function signatures to use int32_t
> > for type consistency when operating on atomic counters, such as those in
> > struct tst_results.
>
> Can we please split the patch into the removal of the assembly and
> separate patch that changes the types?
>

Of course sure. It would be clearer and tidier.



>
> Also do we need to update fuzzy sync library in the second patch in
> order not to produce warnings?


Good point, also we probably need to check all related atomic operations to
ensure no new warnings by the type conversion.

I will rework that into two separate patches and send v3. Thanks!

-- 
Regards,
Li Wang


More information about the ltp mailing list