Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Nov 2014 04:40:24 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274840 - head/sys/cam/ctl
Message-ID:  <201411220440.sAM4eOwY010805@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Nov 22 04:40:24 2014
New Revision: 274840
URL: https://svnweb.freebsd.org/changeset/base/274840

Log:
  Make iSCSI frontend less chatty while waiting for tasks termination.
  
  MFC after:	1 week

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Nov 22 03:03:11 2014	(r274839)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Nov 22 04:40:24 2014	(r274840)
@@ -1058,7 +1058,7 @@ cfiscsi_session_terminate_tasks(struct c
 {
 	struct cfiscsi_data_wait *cdw;
 	union ctl_io *io;
-	int error, last;
+	int error, last, wait;
 
 	if (cs->cs_target == NULL)
 		return;		/* No target yet, so nothing to do. */
@@ -1103,16 +1103,20 @@ cfiscsi_session_terminate_tasks(struct c
 	/*
 	 * Wait for CTL to terminate all the tasks.
 	 */
+	wait = cs->cs_outstanding_ctl_pdus;
+	if (wait > 0)
+		CFISCSI_SESSION_WARN(cs,
+		    "waiting for CTL to terminate %d tasks", wait);
 	for (;;) {
 		refcount_acquire(&cs->cs_outstanding_ctl_pdus);
 		last = refcount_release(&cs->cs_outstanding_ctl_pdus);
 		if (last != 0)
 			break;
-		CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, "
-		    "%d remaining", cs->cs_outstanding_ctl_pdus);
 		tsleep(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus),
 		    0, "cfiscsi_terminate", hz / 100);
 	}
+	if (wait > 0)
+		CFISCSI_SESSION_WARN(cs, "tasks terminated");
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411220440.sAM4eOwY010805>