Thread (24 messages) 24 messages, 5 authors, 2020-08-05

Re: [PATCH] Delay the initialization of rnbd_server module to late_initcall level

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2020-06-23 14:24:04
Also in: linux-rdma

On Tue, Jun 23, 2020 at 07:15:03PM +0530, Haris Iqbal wrote:
On Tue, Jun 23, 2020 at 5:47 PM Jason Gunthorpe [off-list ref] wrote:
quoted
On Tue, Jun 23, 2020 at 03:20:27PM +0530, Haris Iqbal wrote:
quoted
Hi Jason and Leon,

Did you get a chance to look into my previous email?
Was there a question?
Multiple actually :)
quoted
Jason
In response to your emails,
quoted
Somehow nvme-rdma works:
I think that's because the callchain during the nvme_rdma_init_module
initialization stops at "nvmf_register_transport()". Here only the
"struct nvmf_transport_ops nvme_rdma_transport" is registered, which
contains the function "nvme_rdma_create_ctrl()". I tested this in my
local setup and during kernel boot, that's the extent of the
callchain.
The ".create_ctrl"; which now points to "nvme_rdma_create_ctrl()" is
called later from "nvmf_dev_write()". I am not sure when this is
called, probably when the "discover" happens from the client side or
during the server config.

It seems that the "rdma_bind_addr()" is called by the nvme rdma
module; but during the following events
1) When a discover happens from the client side. Call trace for that looks like,
[ 1098.409398] nvmf_dev_write
[ 1098.409403] nvmf_create_ctrl
[ 1098.414568] nvme_rdma_create_ctrl
[ 1098.415009] nvme_rdma_setup_ctrl
[ 1098.415010] nvme_rdma_configure_admin_queue
[ 1098.415010] nvme_rdma_alloc_queue
[ 1098.415032] rdma_resolve_addr
[ 1098.415032] cma_bind_addr
[ 1098.415033] rdma_bind_addr

2) When a connect happens from the client side. Call trace is the same
as above, plus "nvme_rdma_alloc_queue()" is called n number of times;
n being the number of IO queues being created.

On the server side, when an nvmf port is enabled, that also triggers a
call to "rdma_bind_addr()", but that is not from the nvme rdma module.
may be nvme target rdma? (not sure).

Does this make sense or am I missing something here?
It make sense, delaying creating and CM ID's until user space starts
will solve this init time problme
quoted
If the rdma_create_id() is not on a callchain from module_init then you don't have a problem.
I am a little confused. I thought the problem occurs from a call to
either "rdma_resolve_addr()" which calls "rdma_bind_addr()",
or a direct call to "rdma_bind_addr()" as in rtrs case.
In both the cases, a call to "rdma_create_id()" is needed before this.
Right rdma_create_id() must precede anything that has problems, and it
should not be done from module_init.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help