All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Leonardo Brás" <leobras.c@gmail.com>
To: Akira Yokosawa <akiyks@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>
Cc: perfbook@vger.kernel.org
Subject: Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
Date: Sat, 28 Dec 2024 23:25:59 -0300	[thread overview]
Message-ID: <adcb2f2781085d86d26909fa1bb14437a29b2d35.camel@gmail.com> (raw)
In-Reply-To: <24e3f1ee-ce06-44dc-a43f-64ec0a6f4c7b@gmail.com>

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
> 


  parent reply	other threads:[~2024-12-29  2:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-28  7:12 [PATCH v3] CodeSamples: Work around removal of liburcu-signal Akira Yokosawa
2024-12-28 18:04 ` Paul E. McKenney
2024-12-28 18:40   ` Leonardo Brás
2024-12-28 18:49     ` Leonardo Brás
2024-12-28 18:23 ` Leonardo Brás
2024-12-28 18:26   ` Leonardo Brás
2024-12-29  0:17     ` Akira Yokosawa
2024-12-29  0:33       ` Akira Yokosawa
2024-12-29  2:25       ` Leonardo Brás [this message]
2024-12-28 18:30 ` Leonardo Brás

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adcb2f2781085d86d26909fa1bb14437a29b2d35.camel@gmail.com \
    --to=leobras.c@gmail.com \
    --cc=akiyks@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.