On 02/10/19 11:23, Jan Glauber wrote: > I've tried to verify me theory with this patch and didn't run into the > issue for ~500 iterations (usually I would trigger the issue ~20 iterations).
Awesome! That would be a compiler bug though, as atomic_add and atomic_sub are defined as sequentially consistent: #define atomic_add(ptr, n) ((void) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST)) #define atomic_sub(ptr, n) ((void) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST)) What compiler are you using and what distro? Can you compile util/aio-posix.c with "-fdump-rtl-all -fdump-tree-all", zip the boatload of debugging files and send them my way? Thanks, Paolo