From: "Paul E. McKenney" <paulmck@kernel.org>
To: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: rcu@vger.kernel.org, Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Joel Fernandes <joel@joelfernandes.org>,
linux-kernel@vger.kernel.org
Subject: Re: RCU: undefined reference to irq_work_queue
Date: Thu, 17 Mar 2022 09:20:33 -0700 [thread overview]
Message-ID: <20220317162033.GP4285@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <YjNSuprCqjAgGgqB@ip-172-31-19-208.ap-northeast-1.compute.internal>
On Thu, Mar 17, 2022 at 03:24:42PM +0000, Hyeonggon Yoo wrote:
> On Thu, Mar 17, 2022 at 07:00:00AM -0700, Paul E. McKenney wrote:
> > On Thu, Mar 17, 2022 at 11:32:53AM +0000, Hyeonggon Yoo wrote:
> > > Hello RCU folks,
> > >
> > > I like to use minimal configuration for kernel development.
> > > when building with tinyconfig + CONFIG_PREEMPT=y on arm64:
> > >
> > > ld: kernel/rcu/update.o: in function `call_rcu_tasks':
> > > update.c:(.text+0xb2c): undefined reference to `irq_work_queue'
> > > update.c:(.text+0xb2c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `irq_work_queue'
> > > make: *** [Makefile:1155: vmlinux] Error 1
> > >
> > > It seems RCU calls irq_work_queue() without checking if CONFIG_IRQ_WORK is enabled.
> >
> > Indeed it does!
> >
> > And kernel/rcu/Kconfig shows why:
> >
> > config TASKS_TRACE_RCU
> > def_bool 0
> > select IRQ_WORK
> > help
> > This option enables a task-based RCU implementation that uses
> > explicit rcu_read_lock_trace() read-side markers, and allows
> > these readers to appear in the idle loop as well as on the CPU
> > hotplug code paths. It can force IPIs on online CPUs, including
> > idle ones, so use with caution.
> >
> > So the solution is to further minimize your configuration so as to
> > deselect TASKS_TRACE_RCU.
>
> They are already not selected.
Good, thank you.
How about TASKS_RUDE_RCU, TASKS_TRACE_RCU, and TASKS_RCU_GENERIC?
> > This means making sure that both BPF and
> > the various RCU torture tests are all deselected.
>
> I wanted to say call_rcu_tasks() can be referenced even when IRQ_WORK is not
> selected, making it fail to build.
I am guessing because TASKS_RCU_GENERIC is selected?
If so, does the patch at the end of this email help?
> > > ld: kernel/rcu/update.o: in function `call_rcu_tasks':
> > > update.c:(.text+0xb2c): undefined reference to `irq_work_queue'
> > > update.c:(.text+0xb2c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `irq_work_queue'
> > > make: *** [Makefile:1155: vmlinux] Error 1
>
> Isn't it better to fix this build failure?
But of course! However, first I need to know exactly what is causing your
build failure. I cannot see your .config file, so I am having to guess.
Don't get me wrong, I do have a lot of practice guessing, but it is still
just guessing. ;-)
> It fails to build when both TASKS_TRACE_RCU and IRQ_WORK are not selected
> and PREEMPT is selected.
>
> │ Symbol: TASKS_TRACE_RCU [=n] │
> │ Type : bool │
> │ Defined at kernel/rcu/Kconfig:96 │
> │ Selects: IRQ_WORK [=n] │
> │ Selected by [n]: │
> │ - BPF_SYSCALL [=n] │
> │ - RCU_SCALE_TEST [=n] && DEBUG_KERNEL [=y] │
> │ - RCU_TORTURE_TEST [=n] && DEBUG_KERNEL [=y] │
> │ - RCU_REF_SCALE_TEST [=n] && DEBUG_KERNEL [=y]
>
> Thanks!
>
> >
> > Or turn on IRQ_WORK, for example, if you need to use BPF.
Or do you already have TASKS_RCU_GENERIC deselected?
Thanx, Paul
------------------------------------------------------------------------
diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig
index bf8e341e75b4..f559870fbf8b 100644
--- a/kernel/rcu/Kconfig
+++ b/kernel/rcu/Kconfig
@@ -86,6 +86,7 @@ config TASKS_RCU
config TASKS_RUDE_RCU
def_bool 0
+ select IRQ_WORK
help
This option enables a task-based RCU implementation that uses
only context switch (including preemption) and user-mode
next prev parent reply other threads:[~2022-03-17 16:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 11:32 Hyeonggon Yoo
2022-03-17 14:00 ` Paul E. McKenney
2022-03-17 15:24 ` Hyeonggon Yoo
2022-03-17 16:20 ` Paul E. McKenney [this message]
2022-03-17 16:45 ` Hyeonggon Yoo
2022-03-17 17:36 ` Paul E. McKenney
2022-03-17 20:26 ` Randy Dunlap
2022-03-17 20:29 ` Paul E. McKenney
2022-03-17 20:31 ` Randy Dunlap
2022-03-17 20:41 ` Zhouyi Zhou
2022-03-17 20:53 ` Paul E. McKenney
2022-03-18 14:42 ` Hyeonggon Yoo
2022-03-17 15:22 ` Zhouyi Zhou
2022-03-17 15:54 ` Hyeonggon Yoo
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=20220317162033.GP4285@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=42.hyeyoo@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®