From owner-svn-src-all@FreeBSD.ORG Sat Jan 3 18:35:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D739F2C5; Sat, 3 Jan 2015 18:35:30 +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 C367E35E6; Sat, 3 Jan 2015 18:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03IZUmw097083; Sat, 3 Jan 2015 18:35:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03IZU2h097082; Sat, 3 Jan 2015 18:35:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031835.t03IZU2h097082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 18:35:30 +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: r276629 - stable/10/sys/dev/iscsi 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: Sat, 03 Jan 2015 18:35:31 -0000 Author: mav Date: Sat Jan 3 18:35:29 2015 New Revision: 276629 URL: https://svnweb.freebsd.org/changeset/base/276629 Log: MFC r272765: Remove one second wait for threads exit from icl_conn_close(). Switch it from polling with pause() to using cv_wait()/cv_signal(). Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:27:03 2015 (r276628) +++ stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:35:29 2015 (r276629) @@ -776,6 +776,7 @@ icl_receive_thread(void *arg) ICL_CONN_LOCK(ic); ic->ic_receive_running = false; + cv_signal(&ic->ic_send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -1026,6 +1027,7 @@ icl_send_thread(void *arg) STAILQ_CONCAT(&ic->ic_to_send, &queue); ic->ic_send_running = false; + cv_signal(&ic->ic_send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -1330,15 +1332,11 @@ icl_conn_close(struct icl_conn *ic) /* * Wake up the threads, so they can properly terminate. */ - cv_signal(&ic->ic_receive_cv); - cv_signal(&ic->ic_send_cv); while (ic->ic_receive_running || ic->ic_send_running) { //ICL_DEBUG("waiting for send/receive threads to terminate"); - ICL_CONN_UNLOCK(ic); cv_signal(&ic->ic_receive_cv); cv_signal(&ic->ic_send_cv); - pause("icl_close", 1 * hz); - ICL_CONN_LOCK(ic); + cv_wait(&ic->ic_send_cv, ic->ic_lock); } //ICL_DEBUG("send/receive threads terminated");