On Sun, 2024-12-29 at 09:17 +0900, Akira Yokosawa wrote: > Hi, > > Leonardo Brás wrote: > [...] > > > Hi Akira, > > > > > > That's a creative way of dealing with this issue, but if we want to add that > > > complexity, I would rather use $(pkg-config --libs liburcu). > > > > > > Wouldn't this fix the issue as well? > > > > > > Thanks! > > > > Also, according to Paul's comment on v2 patch it shouldn't be needed: > > > > > > On the other hand, sys_membarrier() was introduced in 2015 (5b25b13ab08f6), > > > > and no supported kernel (>v4.2) should still miss this syscall. Is it worth > > > > the added complexity? Is so, let's do it. > > > > > If the -lurcu-signal is left off for old versions of the userspace RCU > > > library, doesn't it simply fall back to using explicit memory barriers? > > > Or am I yet again misremembering? > > > > > Thanx, Paul > > > > Isn't the above correct? > > > > I have no idea ..., but your v2 patch causes this build error with > liburcu <15.0: > > ------------------------------------------------------------------------ > cc -g -O3 -Wall -fcommon -o route_rcu route_rcu.c ../lib/random.c -lpthread -lurcu > /usr/bin/ld: /tmp/ccjHTQfN.o: warning: relocation against `urcu_signal_gp' in read-only section `.text' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock': > /usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:97: undefined reference to `urcu_signal_reader' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock_update': > /usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:75: undefined reference to `urcu_signal_gp' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `urcu_common_wake_up_gp': > /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp' > /usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp' > /usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: undefined reference to `urcu_signal_gp' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `futex': > /usr/include/x86_64-linux-gnu/urcu/futex.h:72: undefined reference to `urcu_signal_gp' > /usr/bin/ld: /tmp/ccjHTQfN.o:/usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: more undefined references to `urcu_signal_gp' follow > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `perftest_reader': > git/perfbook/CodeSamples/defer/routetorture.h:103: undefined reference to `urcu_signal_register_thread' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:126: undefined reference to `urcu_signal_synchronize_rcu' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:128: undefined reference to `urcu_signal_synchronize_rcu' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:130: undefined reference to `urcu_signal_unregister_thread' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_del': > git/perfbook/CodeSamples/defer/route_rcu.c:124: undefined reference to `urcu_signal_call_rcu' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `stresstest_updater': > git/perfbook/CodeSamples/defer/routetorture.h:216: undefined reference to `urcu_signal_register_thread' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:260: undefined reference to `urcu_signal_synchronize_rcu' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:262: undefined reference to `urcu_signal_synchronize_rcu' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:264: undefined reference to `urcu_signal_unregister_thread' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_clear': > git/perfbook/CodeSamples/defer/route_rcu.c:149: undefined reference to `urcu_signal_synchronize_rcu' > /usr/bin/ld: /tmp/ccjHTQfN.o: in function `smoketest': > git/perfbook/CodeSamples/defer/routetorture.h:47: undefined reference to `urcu_signal_register_thread' > /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:62: undefined reference to `urcu_signal_unregister_thread' > /usr/bin/ld: warning: creating DT_TEXTREL in a PIE > collect2: error: ld returned 1 exit status > make[1]: *** [Makefile:134: route_rcu] Error 1 > make[1]: Leaving directory 'git/perfbook/CodeSamples/defer' > ---------------------------------------------------------------- > > This is under Ubuntu 22.04 LTS. > > This looks to me as an unacceptable build regression. Oh, thanks for helping me understand. I thought previously that this would only hit kernels without sys_membarrier() support, but now I get this triggers a build error, which makes sense. Out of curiosity, I did a new version that should take care of this. I will send it as a v4, so please give it a test. > > The use of $(pkg-config --libs liburcu) didn't occur to me. > > I'll give it a try. > > Thanks, Akira >