facebook / facebook/rocksdb

zLinux build on s390x produce warning

Open
#4,022 10 comments 0 reactions 1 assignee Claimed by @adamretter View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

It seems that gcc for -march=z10 shows warning for predefined CACHE_LINE_SIZE 256 introduced in:
16e03882054fa8c947ca84f30b87e1cd3e929597 and ccf5f08f882038e8b481fafa0a0c0b1a04f6a390
```
#ifndef CACHE_LINE_SIZE
-#define CACHE_LINE_SIZE 64U
+ #if defined(__s390__)
+ #define CACHE_LINE_SIZE 256U
...
```

I am not sure what is effect (only performance?) of aligning in RocksDB. Also I do not know what compiler was used so that it did not produced this warning. @grooverdan ?

### Expected behavior
No warning

### Actual behavior
00:01:01.208 CC jls/cache/lru_cache.o
00:01:01.503 In file included from cache/lru_cache.cc:14:0:
00:01:01.503 ./cache/lru_cache.h:157:33: warning: requested alignment 256 is larger than 64 [-Wattributes]
00:01:01.503 class ALIGN_AS(CACHE_LINE_SIZE) LRUCacheShard : public CacheShard {
00:01:01.503 ^
00:01:02.086 CC jls/cache/sharded_cache.o

### Steps to reproduce the behavior
Compile on zLinux s390x with gcc:
[root@linux321 RocksDB_Build_s390x]# uname -a
Linux linux321.ca.com 3.10.0-693.21.1.el7.s390x #1 SMP Fri Mar 23 16:11:08 EDT 2018 s390x s390x s390x GNU/Linux

[root@linux321 RocksDB_Build_s390x]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.