diff options
author | Daniel Black <daniel@mariadb.org> | 2021-02-15 12:31:31 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-02-15 20:27:20 +1100 |
commit | 860213f2ae4fec4faaa9732c70fb17f30420d8ad (patch) | |
tree | 930432e852b36a88bd7575629cbb742d399aef31 | |
parent | da88e1ec12b0ba39552bf54367c1bb3b89eac4a8 (diff) | |
download | mariadb-git-bb-10.3-danielblack-MDEV-23510-arm-lfhash.tar.gz |
MDEV-23510: arm64 lf_hashbb-10.3-danielblack-MDEV-23510-arm-lfhash
volatile has no memory barrier schemantics, its for mmaped IO
so lets allow some optimizer gains and stop pretending it helps
with memory atomicity.
The MDEV lists a SEGV an assumption is made that an address was
partially read. As C packs structs strictly and on arm64 the
cache line size is 128, move the 32bit hashnr to the end so
we don't get the *key pointer split across two cache lines.
-rw-r--r-- | mysys/lf_hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 5dbbc17141f..3e9e8ed3e7e 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -31,10 +31,10 @@ /* An element of the list */ typedef struct { - intptr volatile link; /* a pointer to the next element in a list and a flag */ - uint32 hashnr; /* reversed hash number, for sorting */ + intptr link; /* a pointer to the next element in a list and a flag */ const uchar *key; size_t keylen; + uint32 hashnr; /* reversed hash number, for sorting */ /* data is stored here, directly after the keylen. thus the pointer to data is (void*)(slist_element_ptr+1) @@ -48,7 +48,7 @@ const int LF_HASH_OVERHEAD= sizeof(LF_SLIST); in a list) from l_find to l_insert/l_delete */ typedef struct { - intptr volatile *prev; + intptr *prev; LF_SLIST *curr, *next; } CURSOR; |