From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/3] tst_atomic: drop legacy inline assembly and use __atomic or __sync builtins
Date: Mon, 9 Jun 2025 08:40:48 +0200 [thread overview]
Message-ID: <20250609064048.GB1404144@pevik> (raw)
In-Reply-To: <CAEemH2dbCPKsBUiXKR=Lut1ONmjhjcwWxkjMzYe6B+HbYQUE8A@mail.gmail.com>
> On Fri, Jun 6, 2025 at 10:39 PM Petr Vorel <pvorel@suse.cz> wrote:
> > Hi Li, Cyril,
> > > 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.
> > > The memory order is explicitly set to __ATOMIC_SEQ_CST to preserve strict
> > > sequential consistency, which aligns with the C++11 memory model.
> > > Reference:
> > https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
> > +1
> > Thanks for the work!
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > > Signed-off-by: Li Wang <liwang@redhat.com>
> > > Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> > > +
> > > +/* Use __atomic built-ins (GCC >= 4.7), with sequential consistency. */
> > +1 for documenting this. Hopefully these are old enough to not having to
> > mention
> > it in the docs. But if you think it's not that old, it might be worth
> > later to
> > document it in doc/users/supported_systems.rst.
> > https://linux-test-project.readthedocs.io/en/latest/users/supported_systems.html
> > In that case minimal clang version should be noted as well.
> > BTW I tried to search, should it be clang 3.5?
> > I tried to search but not found.
> > https://clang.llvm.org/docs/LanguageExtensions.html#c11-atomic-builtins
> https://releases.llvm.org/3.1/docs/ReleaseNotes.html
> From the release notes, Clang was implemented __atomic builtins in v3.1.
> And you made a good point, we also need to note the minimal Clang version,
> Something like:
> /* Use __atomic built-ins (GCC >= 4.7, Clang >= 3.1), with sequential
> consistency. */
+1 (no need to repost, please just add it before merge).
> P.s.
> The worth to mention github CI also passed with remove __sync built-ins,
> but to be on safe side, I still keep them in, maybe for someone's use on
> older
> platform.
+1
Kind regards,
Petr
> https://github.com/wangli5665/ltp/commit/3b1b81e662c49b04b79c2bdf807d818984a2dbd9
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-06-09 6:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 11:05 [LTP] [PATCH v3 1/3] tst_atomic: drop legacy inline assembly and use __atomic or __sync builtins Li Wang via ltp
2025-06-06 11:05 ` [LTP] [PATCH v3 2/3] tst_atomic: Introduce tst_atomic_t and apply it consistently Li Wang via ltp
2025-06-06 14:40 ` Petr Vorel
2025-06-09 11:04 ` Cyril Hrubis
2025-06-06 11:05 ` [LTP] [PATCH v3 3/3] lib: moves test infrastructure states into a shared context structure Li Wang via ltp
2025-06-06 14:17 ` Petr Vorel
2025-06-09 12:36 ` Cyril Hrubis
2025-06-10 2:02 ` Li Wang via ltp
2025-06-13 14:54 ` Avinesh Kumar
2025-06-14 10:36 ` Li Wang via ltp
2025-06-06 14:39 ` [LTP] [PATCH v3 1/3] tst_atomic: drop legacy inline assembly and use __atomic or __sync builtins Petr Vorel
2025-06-07 3:16 ` Li Wang via ltp
2025-06-09 6:40 ` Petr Vorel [this message]
2025-06-09 9:51 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250609064048.GB1404144@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.