* [PATCH] rdma engine graceful teardown
@ 2012-03-13 20:57 Yufei Ren
2012-03-15 13:43 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Yufei Ren @ 2012-03-13 20:57 UTC (permalink / raw)
To: fio
For rdma ioengine's one side operation, RDMA_WRITE or RDMA_READ,
server side gets a message from client side that the task is finished.
In previous version, the server simply exit() in td_io_commit() which
causes segmentation fault in thread mode or process hanging in process
mode. This patch achieves graceful tear down by setting up `td->done`
as UDP engine did.
---
diff --git a/engines/rdma.c b/engines/rdma.c
index 54fd194..79d72d2 100644
--- a/engines/rdma.c
+++ b/engines/rdma.c
@@ -674,7 +674,8 @@ static int fio_rdmaio_recv(struct thread_data *td, struct io
_u **io_us,
rdma_poll_wait(td, IBV_WC_RECV);
dprint(FD_IO, "fio: recv FINISH message\n");
- exit(0);
+ td->done = 1;
+ return 0;
}
return i;
diff --git a/ioengines.c b/ioengines.c
index 4c609f2..e1605c4 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -208,6 +208,16 @@ int td_io_getevents(struct thread_data *td, unsigned int mi
n, unsigned int max,
{
int r = 0;
+ /*
+ * For ioengine=rdma one side operation RDMA_WRITE or RDMA_READ,
+ * server side gets a message from the client
+ * side that the task is finished, and
+ * td->done is set to 1 after td_io_commit(). In this case,
+ * there is no need to reap complete event in server side.
+ */
+ if (td->done)
+ return 0;
+
if (min > 0 && td->io_ops->commit) {
r = td->io_ops->commit(td);
if (r < 0)
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rdma engine graceful teardown
2012-03-13 20:57 [PATCH] rdma engine graceful teardown Yufei Ren
@ 2012-03-15 13:43 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2012-03-15 13:43 UTC (permalink / raw)
To: Yufei Ren; +Cc: fio
On 03/13/2012 09:57 PM, Yufei Ren wrote:
> For rdma ioengine's one side operation, RDMA_WRITE or RDMA_READ,
> server side gets a message from client side that the task is finished.
> In previous version, the server simply exit() in td_io_commit() which
> causes segmentation fault in thread mode or process hanging in process
> mode. This patch achieves graceful tear down by setting up `td->done`
> as UDP engine did.
It's a bit of a hack, but if it improves the situation, I'm fine with
it. Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-15 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-13 20:57 [PATCH] rdma engine graceful teardown Yufei Ren
2012-03-15 13:43 ` Jens Axboe
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.