tcp_sendpages/tcp_sendmsg can wait sndtmo seconds if a connection goes bad. This then delays session recovery, because that code must wait for the xmit thread to flush. OTOH, if we did not wait at all we are less efficient in the lock management because we must reacquire the session lock every time the network layer returns ENOBUFS and runs iscsi_tcp's write_space callout.
This tries to balance the two by reducing the wait to 3 seconds from 15. If we have waited 3 secs to send a pdu then perf is already taking a hit so grabbing the session lock again is not going to make a difference. And waiting up to 3 secs for the xmit thread to flush and suspend is not that long (at least a lot better than 15). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~----------~----~----~----~------~----~------~--~---
>From 8bb71f4b2b659094d88b2d6a4fe3377e955fda4e Mon Sep 17 00:00:00 2001 From: Mike Christie <micha...@cs.wisc.edu> Date: Wed, 29 Jul 2009 21:42:42 -0500 Subject: [PATCH 1/2] iscsi_tcp: reduce sk sndtmo tcp_sendpages/tcp_sendmsg can wait sndtmo seconds if a connection goes bad. This then delays session recovery, because that code must wait for the xmit thread to flush. OTOH, if we did not wait at all we are a less efficient in the lock management because we must reacquire the session lock every time the network layer returns ENOBUFS and runs iscsi_tcp's write_space callout. This tries to balance the two, but reducing the wait to 3 seconds from 15. If we have waited 3 secs to send a pdu then perf is already taking a hit so grabbing the session lock again is not going to make a difference. And waiting up to 3 secs for the xmit thread to flush is not that long (at least a lot better than 15). --- drivers/scsi/iscsi_tcp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index c7e2ff2..4160167 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -301,7 +301,7 @@ static int iscsi_sw_tcp_xmit(struct iscsi_conn *conn) * for it to do the right thing. */ if (rc == -EAGAIN) - return rc; + return -ENOBUFS; else if (rc < 0) { rc = ISCSI_ERR_XMIT_FAILED; goto error; @@ -693,7 +693,7 @@ iscsi_sw_tcp_conn_bind(struct iscsi_cls_session *cls_session, /* setup Socket parameters */ sk = sock->sk; sk->sk_reuse = 1; - sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */ + sk->sk_sndtimeo = 3 * HZ; /* FIXME: make it configurable */ sk->sk_allocation = GFP_ATOMIC; iscsi_sw_tcp_conn_set_callbacks(conn); -- 1.6.2.2