pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: greg@burd.me
Subject: Re: IO in wrong state on riscv64
Date: Sat, 08 Nov 2025 14:26:14 -0500
Message-ID: <1496141.1762629974@sss.pgh.pa.us> (raw)
In-Reply-To: <1340546.1762561464@sss.pgh.pa.us>
References: <d79691be-22bd-457d-9d90-18033b78c40a@gmail.com>
	<CA+hUKG+X=FKYecrpZaWNkWJZkQQWu6v2LvcD4nof1UftF7nZ9A@mail.gmail.com>
	<60bbebf4-0a80-4e5f-83c0-311c85f6bd5c@gmail.com>
	<CA+hUKGKRZufVhDEc1NDUXXHpTd9Q8gmvqbU+2cOUJZnK_TYJGA@mail.gmail.com>
	<c4cf94c2-e61c-444b-814f-1df85e52a39f@gmail.com>
	<CA+hUKGLpP2T90M3eEPB95KfB4PtdfVnEUNH+aoRiXfSk-ODJkQ@mail.gmail.com>
	<f2378a85-c968-4ccf-acf3-bca6f5c50c87@gmail.com>
	<CA+hUKGKcdkNTkn9C2MT3zM3ZTVLZTZTiLKXkWVDYWh4w7MNACA@mail.gmail.com>
	<CA+hUKGJKqC2VSg8_MCB4_3air3Zhk8x8K99KxHtLuoFFdVFnvg@mail.gmail.com>
	<w3qc4gzqywinffeglpwyxbwocpsjvh3yqqy5d42zsqhciy3yr5@tb63f2ipdzrl>
	<CA+hUKGLJHW7QjNGpfo+yKD6GzhdVnHxaSf0QJZp4VTu7jAt68A@mail.gmail.com>
	<927941c8-e5a1-4787-bbd9-88f0d92b55d0@gmail.com>
	<CA+hUKGKt5o70MB0Yj8QYNOjR3xTH8fTJQ09WdkvA_Rdg-Qag8w@mail.gmail.com>
	<CA+hUKGJt82c69MwXwxCnYJTJadMmmtVqeZnApQCJPoVyOOZR1A@mail.gmail.com>
	<1338407.1762560226@sss.pgh.pa.us>
	<CA+hUKGLuNvLxdiwGQYjTWzh0W3JQoqegmOa9eOgpAPNDr-M+mg@mail.gmail.com>
	<1340546.1! 762561464@sss.pgh.pa.us>

... BTW, I wonder why you did not add pg_compiler_barrier_impl()
to our other use of __atomic_thread_fence:

#if !defined(pg_memory_barrier_impl)
#    if defined(HAVE_GCC__ATOMIC_INT32_CAS)
#        define pg_memory_barrier_impl()        __atomic_thread_fence(__ATOMIC_SEQ_CST)
#    elif defined(__GNUC__)
#        define pg_memory_barrier_impl()        __sync_synchronize()
#    endif
#endif /* !defined(pg_memory_barrier_impl) */

If the problem is that Clang doesn't treat __atomic_thread_fence
as a compiler barrier, why is this usage safer than the other two?

			regards, tom lane





view thread (22+ messages)  latest in thread

Message-ID: <1496141.1762629974@sss.pgh.pa.us>
Permalink:  ../1496141.1762629974@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1496141.1762629974@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, exclusion@gmail.com, andres@anarazel.de, greg@burd.me
  Subject: Re: IO in wrong state on riscv64
  In-Reply-To: <1496141.1762629974@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox