From owner-svn-src-all@FreeBSD.ORG Fri Nov 28 08:56:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D20E4ED; Fri, 28 Nov 2014 08:56:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 136737D8; Fri, 28 Nov 2014 08:56:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAS8ubKx084959; Fri, 28 Nov 2014 08:56:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAS8ubpY084958; Fri, 28 Nov 2014 08:56:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411280856.sAS8ubpY084958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 28 Nov 2014 08:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275203 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 08:56:38 -0000 Author: mav Date: Fri Nov 28 08:56:37 2014 New Revision: 275203 URL: https://svnweb.freebsd.org/changeset/base/275203 Log: MFC r274840, r274940: Make iSCSI frontend less chatty while waiting for tasks termination. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 28 08:54:43 2014 (r275202) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 28 08:56:37 2014 (r275203) @@ -1062,7 +1062,7 @@ cfiscsi_session_terminate_tasks(struct c { struct cfiscsi_data_wait *cdw; union ctl_io *io; - int error, last; + int error, last, wait; io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { @@ -1078,6 +1078,7 @@ cfiscsi_session_terminate_tasks(struct c io->io_hdr.nexus.targ_lun = 0; io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ io->taskio.task_action = CTL_TASK_I_T_NEXUS_RESET; + wait = cs->cs_outstanding_ctl_pdus; refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { @@ -1105,16 +1106,19 @@ cfiscsi_session_terminate_tasks(struct c /* * Wait for CTL to terminate all the tasks. */ + 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