public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Eddie Wai <eddie.wai@broadcom.com>
Cc: James Bottomley <jbottomley@parallels.com>,
	open-iscsi <open-iscsi@googlegroups.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Michael Chan <mchan@broadcom.com>,
	Anil Veerabhadrappa <anilgv@broadcom.com>,
	Ben Li <benli@broadcom.com>
Subject: Re: [PATCH] LIBISCSI: Alleviate NOP transmission request upon xmit failure
Date: Wed, 14 Mar 2012 21:00:09 -0500	[thread overview]
Message-ID: <4F614D29.3090108@cs.wisc.edu> (raw)
In-Reply-To: <4F614AC1.2080906@cs.wisc.edu>

On 03/14/2012 08:49 PM, Mike Christie wrote:
> On 03/14/2012 06:50 PM, Eddie Wai wrote:
>> During heavy I/O transmission, it was observed that network packets
>> can get dropped when no link flow control is enabled.  When this happens,
>> I/O completions can exceed the default NOP transmission of 5s while the
>> hw send queue resource backs up.  When the queue gets full, NOP
>> transmission requests will also get blocked.  It was observed that
>> the NOP transmission requests will keep repeatedly try to send out
>> the NOP while holding the session lock.  This is very intrusive as the
>> requests are being called on every timer execution since the last_ping
>> parameter doesn't get updated upon transmission failure.  This creates a
>> tremendous bottleneck especially when the connection is about to get torn down.
>>
>> This patch alleviates the pounding of the NOP transmission in the
>> iscsi_check_transport_timeouts routine by injecting an artifical 1s delay
>> in between each NOP transmission requests due to failures upon timeout.
>>
>> There is no need to keep pounding on to request this data provoking NOP
>> transmission continuously when the transmit queue is full.
>>
>> Please review and comment.  Thanks.
>>
>>
>> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
>> ---
>>  drivers/scsi/libiscsi.c |   13 +++++++++----
>>  1 files changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
>> index 82c3fd4..f1141a8 100644
>> --- a/drivers/scsi/libiscsi.c
>> +++ b/drivers/scsi/libiscsi.c
>> @@ -940,13 +940,14 @@ static void iscsi_tmf_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
>>  	wake_up(&conn->ehwait);
>>  }
>>  
>> -static void iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
>> +static struct iscsi_task *iscsi_send_nopout(struct iscsi_conn *conn,
>> +					    struct iscsi_nopin *rhdr)
>>  {
>>          struct iscsi_nopout hdr;
>>  	struct iscsi_task *task;
>>  
>>  	if (!rhdr && conn->ping_task)
>> -		return;
>> +		return NULL;
>>  
>>  	memset(&hdr, 0, sizeof(struct iscsi_nopout));
>>  	hdr.opcode = ISCSI_OP_NOOP_OUT | ISCSI_OP_IMMEDIATE;
>> @@ -967,6 +968,7 @@ static void iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
>>  		conn->ping_task = task;
>>  		conn->last_ping = jiffies;
>>  	}
>> +	return task;
>>  }
>>  
>>  static int iscsi_nop_out_rsp(struct iscsi_task *task,
>> @@ -2059,8 +2061,11 @@ static void iscsi_check_transport_timeouts(unsigned long data)
>>  	if (time_before_eq(last_recv + recv_timeout, jiffies)) {
>>  		/* send a ping to try to provoke some traffic */
>>  		ISCSI_DBG_CONN(conn, "Sending nopout as ping\n");
>> -		iscsi_send_nopout(conn, NULL);
>> -		next_timeout = conn->last_ping + (conn->ping_timeout * HZ);
>> +		if (iscsi_send_nopout(conn, NULL))
>> +			next_timeout = conn->last_ping +
>> +				       (conn->ping_timeout * HZ);
> 
> Once we send a ping, we should not run this timer again until it has
> timed out Why is the ping not timing out and then why are not hitting
> the check above this that just returns?
> 
> Is the timer firing early, so we keep hitting the iscsi_send_nopout path?

One other side issue, when we get any completion we update the
conn->last_recv field, so we should not try another ping for another
recv_timeout seconds. If the above code is getting called to send a
ping, then we are not getting any completion for recv_timeout seconds.

Is there a way to tell if the card is making progress? For example if we
were doing a lot of big writes, then the card could be making progress
on them and handling R2Ts and sending data, but the libiscsi layer does
not know, so it could fail the connection thinking that we did not get a
response when the card was really busy handling R2Ts.


  reply	other threads:[~2012-03-15  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 23:50 [PATCH] LIBISCSI: Alleviate NOP transmission request upon xmit failure Eddie Wai
2012-03-15  1:49 ` Mike Christie
2012-03-15  2:00   ` Mike Christie [this message]
2012-03-15  7:02     ` Eddie Wai
2012-03-15 18:48       ` Mike Christie
2012-03-15 18:53         ` Mike Christie
2012-03-15  6:53   ` Eddie Wai

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=4F614D29.3090108@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=anilgv@broadcom.com \
    --cc=benli@broadcom.com \
    --cc=eddie.wai@broadcom.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=open-iscsi@googlegroups.com \
    /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