[PATCH] Native spinlock support on RISC-V
Marek Szuba <marecki@gentoo.org>
From: Marek Szuba <marecki@gentoo.org>
To: pgsql-hackers@postgresql.org
Date: 2021-08-13T11:54:52Z
Lists: pgsql-hackers
Attachments
- postgresql-riscv-spinlocks.patch (text/x-patch) patch
Hello, The attached patch adds native spinlock support to PostgreSQL on RISC-V systems. As suspected by Richard W.M. Jones of Red Hat back in 2016, the __sync_lock_test_and_set() approach applied on arm and arm64 works here as well. Tested against PostgreSQL 13.3 on a physical rv64gc system (BeagleV Starlight beta board) - builds and installs fine, all tests pass. From what I can see in gcc documentation this should in theory work on rv32 (and possibly rv128) as well, therefore the patch as it stands covers all RISC-V systems (i.e. doesn't check the value of __risc_xlen) - but I haven't confirmed this experimentally. -- MS
Commits
-
Add RISC-V spinlock support in s_lock.h.
- 4ffbd55d9346 14.0 landed
- c32fcac56a21 15.0 landed
- 582a2affa4a9 9.6.24 landed
- 7915a9515cfb 10.19 landed
- 8024ff478ba7 11.14 landed
- cdda2b247dd5 12.9 landed
- 48695decc271 13.5 landed