> There's some special casing in that routine for s390x to read the config from /sys; at least my rpi 3b+ has the same file with reasonable looking data:
> Perhaps the #if defined(__s390x__) should grow an || defined(__aarch64__) or similar?
Agreed. I would go further and suggest an arch-agnostic change…
```
#elif defined(__linux__)
static inline size_t _cache_line_size() { Bug #32619199 SYSCONF CALLED WITHOUT ERROR CHECKING
long size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
if (size > 0)
return static_cast<size_t>(size);
// Known to return 0 on s390x RHEL 7.x, and armhf
FILE *p = fopen(
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
if (p) {
fscanf(p, "%ld", &size);
fclose(p);
}
if (size > 0)
return static_cast<size_t>(size);
+1 to what seth-arnold wrote above (https:/ /bugs.launchpad .net/ubuntu/ +source/ mysql-8. 0/+bug/ 2019203/ comments/ 6)
> There's some special casing in that routine for s390x to read the config from /sys; at least my rpi 3b+ has the same file with reasonable looking data:
Yes. According to the git-blame (https:/ /github. com/mysql/ mysql-server/ blame/ea7087d88 5006918ad54458e 7aad215b1650312 c/sql/memory/ aligned_ atomic. h#L82), there was a follow-up commit to apply a very similar patch for s390.
https:/ /github. com/mysql/ mysql-server/ commit/ f2d64bfa5757002 34d5f36418d5ef1 43b54e2a16
> Perhaps the #if defined(__s390x__) should grow an || defined( __aarch64_ _) or similar?
Agreed. I would go further and suggest an arch-agnostic change…
``` _SC_LEVEL1_ DCACHE_ LINESIZE) ; cast<size_ t>(size) ;
#elif defined(__linux__)
static inline size_t _cache_line_size() {
Bug #32619199 SYSCONF CALLED WITHOUT ERROR CHECKING
long size = sysconf(
if (size > 0)
return static_
// Known to return 0 on s390x RHEL 7.x, and armhf
FILE *p = fopen( /sys/devices/ system/ cpu/cpu0/ cache/index0/ coherency_ line_size" , "r"); cast<size_ t>(size) ;
"
if (p) {
fscanf(p, "%ld", &size);
fclose(p);
}
if (size > 0)
return static_
// Default to 64
return 64;
#endif
```