Re: IO in wrong state on riscv64

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, greg(at)burd(dot)me
Subject: Re: IO in wrong state on riscv64
Date: 2025-10-14 04:00:00
Message-ID: f2378a85-c968-4ccf-acf3-bca6f5c50c87@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Thomas,

13.10.2025 08:40, Thomas Munro wrote:
> Thanks. All seems to have something plausible in the right places,
> but I know nothing about RISC-V... hmm, what happens if you replace
> pg_{read,write}_barrier() with pg_memory_barrier(), in those three
> functions? And if it happens to help, perhaps you could try to figure
> out which one(s) help? Not that it should be necessary but as a clue
> or to rule out this line of enquiry... I guess that should generate
> FENCE RW,RW, meaning wait for all preceding reads and writes to
> complete and don't let any following reads or writes begin, but that's
> just from googling...

The replacements doesn't work for me, unfortunately: I have 3 out of 30
027_stream_regress test runs failed:
2025-10-13 21:27:26.161 UTC [4181290:5] pg_regress/brin ERROR:  IO in wrong state: 0
2025-10-13 21:27:26.161 UTC [4181290:6] pg_regress/brin STATEMENT: CREATE TABLE brintest (byteacol bytea,

Disassembly of those three functions is attached.

I'll try to find some simple C programs to test memory barriers outside of
postgres...

Best regards,
Alexander

Attachment Content-Type Size
pgaio_io_reclaim.asm text/plain 28.2 KB
pgaio_io_update_state.asm text/plain 24.4 KB
pgaio_io_was_recycled.asm text/plain 1.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Alger 2025-10-14 04:03:13 Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Previous Message Michael Paquier 2025-10-14 03:42:59 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)