linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* supporting DEVICE_REMOVAL on RPC-over-RDMA transports
@ 2017-02-22 21:31 Chuck Lever
  2017-02-23  3:25 ` Trond Myklebust
  0 siblings, 1 reply; 6+ messages in thread
From: Chuck Lever @ 2017-02-22 21:31 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing List

Hey Trond-

To support the ability to unload the underlying RDMA device's kernel
driver while NFS mounts are active, xprtrdma needs the ability to
suspend RPC sends temporarily while the transport hands HW resources
back to the driver. Once the device driver is unloaded, the RDMA
transport is left disconnected, and RPCs will be suspended normally
until a connection is possible again (eg, a new device is made
available).

A DEVICE_REMOVAL event is an upcall to xprtrdma that may sleep. Upon
its return, the device driver unloads itself. Currently my prototype
frees all HW resources during the upcall, but that doesn't block
new RPCs from trying to use those resources at the same time.

Seems like the most natural way to temporarily block sends would be
to grab the transport's write lock, just like "connect" does, while
the transport is dealing with DEVICE_REMOVAL, then release it once
all HW resources have been freed.

Unfortunately an RPC task is needed to acquire the write lock. But
disconnect is just an asynchronous event, there is no RPC task
associated with it, and thus no context that the RPC scheduler
can put to sleep if there happens to be another RPC sending at the
moment a device removal event occurs.

I was looking at xprt_lock_connect, but that doesn't appear to do
quite what I need.

Another thought was to have the DEVICE_REMOVAL upcall mark the
transport disconnected, send an asynchronous NULL RPC, then wait
on a kernel waitqueue.

The NULL RPC would grab the write lock and kick the transport's
connect worker. The connect worker would free HW resources, then
awaken the waiter. Then the upcall could return to the driver.

The problem with this scheme is the same as it was for the
keepalive work: there's no task or rpc_clnt available to the
DEVICE_REMOVAL upcall. Sleeping until the write lock is available
would require a task, and sending a NULL RPC would require an
rpc_clnt.

Any advice/thoughts about this?


--
Chuck Lever




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-03 21:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22 21:31 supporting DEVICE_REMOVAL on RPC-over-RDMA transports Chuck Lever
2017-02-23  3:25 ` Trond Myklebust
2017-02-23  3:33   ` Trond Myklebust
2017-02-23 14:54   ` Chuck Lever
2017-02-23 15:30     ` Trond Myklebust
2017-03-03 21:46       ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).