Date: Fri, 3 Mar 2017 06:02:27 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314580 - stable/11/sys/dev/iscsi Message-ID: <201703030602.v2362RUg005891@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Mar 3 06:02:27 2017 New Revision: 314580 URL: https://svnweb.freebsd.org/changeset/base/314580 Log: MFC r313851: Fix tight loop spinning on postponed requests. Modified: stable/11/sys/dev/iscsi/iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 03:11:58 2017 (r314579) +++ stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 06:02:27 2017 (r314580) @@ -475,15 +475,14 @@ iscsi_maintenance_thread_terminate(struc static void iscsi_maintenance_thread(void *arg) { - struct iscsi_session *is; - - is = arg; + struct iscsi_session *is = arg; + ISCSI_SESSION_LOCK(is); for (;;) { - ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - STAILQ_EMPTY(&is->is_postponed)) + (STAILQ_EMPTY(&is->is_postponed) || + ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn))) cv_wait(&is->is_maintenance_cv, &is->is_lock); /* Terminate supersedes reconnect. */ @@ -497,12 +496,13 @@ iscsi_maintenance_thread(void *arg) if (is->is_reconnecting) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_reconnect(is); + ISCSI_SESSION_LOCK(is); continue; } iscsi_session_send_postponed(is); - ISCSI_SESSION_UNLOCK(is); } + ISCSI_SESSION_UNLOCK(is); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703030602.v2362RUg005891>