Hi, I have a problem using rwlock or rcu (read-copy-update) if compile con visualkernel in debug mode. The compile failed with error “error : call to ‘__compiletime_assert_142’ declared with attribute error: Need native word sized stores/loads for atomicity.” The cause is to be attributed to disable all optimizations during compilation (rightly) by the -O0 parameter.
Do you have any suggestions on how to use rwlock and rcu in debug mode without enabling optimizations ?
Most likely you would need to set the “optimize” attribute on some of the inline functions in the kernel headers. Please check the build log for the actual function that calls __smp_store_release(), e.g.:
1><...>\include\asm-generic\qrwlock.h(165,2):note:inexpansion of macro`smp_store_release'
E.g. with kernel 4.10 you would need to set the optimization for the queued_write_unlock() function: