Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Mar 2021 20:29:38 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: afc3e54eeee6 - main - Move ic_check_send_space clear to the actual check.
Message-ID:  <202103032029.123KTcTN060202@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=afc3e54eeee635a525c88e4678cc38e3219302c3

commit afc3e54eeee635a525c88e4678cc38e3219302c3
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-03-03 20:21:26 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-03-03 20:29:35 +0000

    Move ic_check_send_space clear to the actual check.
    
    It closes tiny race when the flag could be set between being cleared
    and the space is checked, that would create us some more work.  The
    flag setting is protected by both locks, so we can clear it in either
    place, but in between both locks are dropped.
    
    MFC after:      1 week
---
 sys/dev/iscsi/icl_soft.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index 57ab24defabb..9cede6b44311 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -866,6 +866,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue)
 	 * of error.
 	 */
 	available = sbspace(&so->so_snd);
+	ic->ic_check_send_space = false;
 
 	/*
 	 * Notify the socket upcall that we don't need wakeups
@@ -978,7 +979,6 @@ icl_send_thread(void *arg)
 			if (STAILQ_EMPTY(&queue) || ic->ic_check_send_space)
 				STAILQ_CONCAT(&queue, &ic->ic_to_send);
 
-			ic->ic_check_send_space = false;
 			ICL_CONN_UNLOCK(ic);
 			icl_conn_send_pdus(ic, &queue);
 			ICL_CONN_LOCK(ic);



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