From nobody Fri Jun 24 19:36:59 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 79B8686464D; Fri, 24 Jun 2022 19:37:00 +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 4LV6nl6f5Wz4XMb; Fri, 24 Jun 2022 19:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656099420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oMpoKXbdSwgBaU4PGAW2SEKuGYTENF/hsekLuKBTMOM=; b=mJoQEX61jVt34how0abeGWYcMMnnuEyzV9bWL85KpdnDSSXdgL3PNLIaflIJm/SGzhf9gc VowA+5z9il2vAXvGqqvbig6v5DcNZ2SsWkDAy3ENXrSK2OFpJqul4XPG5nCAKEvLfjp3QX TTZKdf0Mb8NbzGobFbBZfvCdtFzBjW6DtTH1p+cQN+vFqlqWxHHFq83OEu4XfkOEhshkew ktjgBJfbCp8ngAXyuQIzR/0qE5fDtFuy8C8zS3TT84kMr13kAfbU0QRBFUDYgk2pHFjP7v Ev+Bo1BsAmzCSggGvN/J79U7PbKgy6/zD6J7TjpoQ9dQNO6hn+kHv19oj8EKvg== 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 8A4CA15F71; Fri, 24 Jun 2022 19:36:59 +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 25OJaxQG084261; Fri, 24 Jun 2022 19:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25OJax24084260; Fri, 24 Jun 2022 19:36:59 GMT (envelope-from git) Date: Fri, 24 Jun 2022 19:36:59 GMT Message-Id: <202206241936.25OJax24084260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 36f99db22bff - stable/13 - weed_inhib(): correct the condition to re-suspend a thread List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36f99db22bff11c1ec3290d18fba15534fd348a3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656099420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oMpoKXbdSwgBaU4PGAW2SEKuGYTENF/hsekLuKBTMOM=; b=FvJEDMOqNaj8RTmvQSIVoJfehIHRx2sZdUIz57LMU4F103GgXo1u1eiwltHZUv5FjUQLbR g5g/VAiAs8z5RHbtzpIwPO5DRRlai6EZd5M8WNgmxl4DN3h44BwPLRVJrojBtv44AZTZLt HNxachJ+jrUdCBz/StFIm1xcCk8bgZdxKpvYQ12eMo986a6WiIRm3ps/ZTlJ9hpnO2S0n9 r7g91Yvee0Po0vcMs80A3yvKs5DOQix+VBF7EP18KKEXhNzFhIZban+SLbdPXsNEhomCny xs1kJxxqIn5Pts+H1sbhiadB1EMMeAXkPeFBepduffjC4EMUitZBu/l7h0We6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656099420; a=rsa-sha256; cv=none; b=ciOXKM3QIn2+VnePpIpYNq+N166Vt3Mhs1ylBy4qH0vTE0W8GarYNLPwUSHC2IOts4yGZ+ G1xbXHtO8ZSu63kcTpOSsx3JKtZQHEGwHvkwKEYUbcxX/fuHWTqylGlHh94njINAxlsm8j 7AIPkQzVWTmRrtCUPW5YVsvDvNwHRHyO2WMv1SBYK1GPiQIFIQK5a2hUjQcqzxp11jTD17 U45rYfdRT445sjG0c7FW8s7F23dvGLm1dCdRu9UBQiaEjHQLVE/9w0VmLddryaUCUhTjBY qDhsJ518l16EetcCXVf1Ff/AdD1q3+rqxRL5H++2kp1LVsRW9q8nSVdudXWtWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=36f99db22bff11c1ec3290d18fba15534fd348a3 commit 36f99db22bff11c1ec3290d18fba15534fd348a3 Author: Konstantin Belousov AuthorDate: 2022-05-10 23:37:58 +0000 Commit: Konstantin Belousov CommitDate: 2022-06-24 14:45:45 +0000 weed_inhib(): correct the condition to re-suspend a thread (cherry picked from commit dd883e9a7e8045d86774fa3f944b53a4f78d0fd0) --- sys/kern/kern_thread.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 10b3f1a27876..f55011fe9613 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1132,25 +1132,20 @@ restart: * ALLPROC suspend tries to avoid spurious EINTR for * threads sleeping interruptable, by suspending the * thread directly, similarly to sig_suspend_threads(). - * Since such sleep is not performed at the user - * boundary, TDF_BOUNDARY flag is not set, and TDF_ALLPROCSUSP - * is used to avoid immediate un-suspend. + * Since such sleep is not neccessary performed at the user + * boundary, TDF_ALLPROCSUSP is used to avoid immediate + * un-suspend. */ - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & (TDF_BOUNDARY | - TDF_ALLPROCSUSP)) == 0) { + if (TD_IS_SUSPENDED(td2) && (td2->td_flags & + TDF_ALLPROCSUSP) == 0) { wakeup_swapper |= thread_unsuspend_one(td2, p, false); thread_lock(td2); goto restart; } if (TD_CAN_ABORT(td2)) { - if ((td2->td_flags & TDF_SBDRY) == 0) { - if (!TD_IS_SUSPENDED(td2)) - thread_suspend_one(td2); - td2->td_flags |= TDF_ALLPROCSUSP; - } else { - wakeup_swapper |= sleepq_abort(td2, ERESTART); - return (wakeup_swapper); - } + td2->td_flags |= TDF_ALLPROCSUSP; + wakeup_swapper |= sleepq_abort(td2, ERESTART); + return (wakeup_swapper); } break; default: