Re: Detection of hadware feature => please do not use signal
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Bastien Roucariès <rouca@debian.org>, pgsql-bugs@lists.postgresql.org
Date: 2024-11-23T01:39:55Z
Lists: pgsql-bugs
Attachments
- netbsd-arm-crc-detection.patch (text/x-diff) patch
Thomas Munro <thomas.munro@gmail.com> writes: > Unfortunately it looks like NetBSD doesn't put AT_HWCAP into its > auxv[], or even expose it to user space nicely, and those libraries > don't seem to know of another way. Hopefully NetBSD will align with > those other systems for portability's sake. The only other way I > could find in a quick googling session is /usr/sbin/cpuctl, root only, > no cigar (but a solid clue that the information is floating around > somewhere, it just depends where exactly the root-only fencing is > happening). I poked into this with NetBSD and found that cpuctl's "identify" option works just fine without root. So that motivated me to dig into its source code, and I end up with the attached. Sadly it only works in 64-bit; there is presumably a way to detect this in 32-bit as well, but cpuctl doesn't know it. That doesn't bother me a whole lot though, at least not nearly as much as the 64-bit case. Anybody running PG on 32-bit ARM shouldn't be expecting great performance. I've checked this on NetBSD 9.2 and 10.0. I don't have hardware that should return false (and there may not be any such 64-bit hardware anyway...), so there's not much more I can test. regards, tom lane
Commits
-
Update configure probes for CFLAGS needed for ARM CRC instructions.
- e266a0ed67d2 17.3 landed
- 851c6ff18fd3 15.11 landed
- 5980f1884fc9 18.0 landed
- 32057a0f791e 13.19 landed
- 2fc0199a5015 14.16 landed
- 1f4aadec41b8 16.7 landed
-
Support runtime CRC feature probing on NetBSD/ARM using sysctl().
- 4570b22666dd 18.0 landed
-
Use auxv to check for CRC32 instructions on ARM.
- aac831cafa6f 18.0 landed
-
Improve our method for probing the availability of ARM CRC instructions.
- 1c72ec6f4989 11.0 cited