[Date Prev][Date Next]
Re: (ITS#7969) LMDB: Globally shared fields of meta-data are not 'volatile'.
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#7969) LMDB: Globally shared fields of meta-data are not 'volatile'.
- From: email@example.com
- Date: Mon, 12 Jan 2015 18:15:14 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
2014-11-16 0:04 GMT+03:00 Hallvard Breien Furuseth <firstname.lastname@example.org>:
> __sync_synchronize() needs an #ifdef around it.
> #ifdef __GNUC__, or something more general?
> Not sure what to do for the #else. We could mostly
> avoid using mm_txnid when the lockfile is initialized
> and use mti_txnid instead (e.g. in pick_meta). And
> penalize MDB_NOLOCK with some sync call in the #else.
Unfortunately IMDB programmed without accounting possibility of memory
reordering and cache incoherency (as a proof - the 'volatile' was
missed before ITS#7969).
So, currently seems LMDB is durable only on x86 and may be on MIPS.
I think memory-ordering (e.g. barriers) functions should be defined in
separate h-file, which will select implementation depends on cpu-arch
The minimum seems to be required a memory_barrier_coherence() - to
make cache coherence and suppress dangerously load/store reordering,
e.g. flush/invalidate cache on some cpu-arch, but do nothing on x86
and so on.
Then __sync_synchronize() and MIPS's cache invalidate should be
replaced with memory_barrier_coherence().
But instead the original version recreate cleanly on the basis of
1Hippeus engine (manager of shared memory and queues for zero-copy
IPC, google it).