From owner-dev-commits-src-all@freebsd.org Mon Mar 15 03:01:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A97FC56CD8E; Mon, 15 Mar 2021 03:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DzLmK3ZMJz3QZC; Mon, 15 Mar 2021 03:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2A541199; Mon, 15 Mar 2021 03:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12F31XoF098089; Mon, 15 Mar 2021 03:01:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12F31XTd098088; Mon, 15 Mar 2021 03:01:33 GMT (envelope-from git) Date: Mon, 15 Mar 2021 03:01:33 GMT Message-Id: <202103150301.12F31XTd098088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 6cd4542786f9 - stable/12 - Move ic_check_send_space clear to the actual check. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6cd4542786f929ea57604662d7d5537f13261382 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2021 03:01:38 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6cd4542786f929ea57604662d7d5537f13261382 commit 6cd4542786f929ea57604662d7d5537f13261382 Author: Alexander Motin AuthorDate: 2021-03-03 20:21:26 +0000 Commit: Alexander Motin CommitDate: 2021-03-15 02:54:56 +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 (cherry picked from commit afc3e54eeee635a525c88e4678cc38e3219302c3) --- 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 d995bedbcb72..454afe15c398 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -802,6 +802,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 @@ -915,7 +916,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);