From nobody Mon Jun 13 19:33:32 2022 X-Original-To: dev-commits-src-main@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 A9C9D854B4E; Mon, 13 Jun 2022 19:33:33 +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 4LMMDs1s2Cz3qFZ; Mon, 13 Jun 2022 19:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655148813; 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=V6tb5o+NWXIyIi5V0xRoF5nz1MItfDTcldvC90nNSrk=; b=B90x1gtMLjuzBsN6gLzsmqku8CMQyGBJozjXYAA5CqXGdPjo3KMVuCRcOf2cC49jr7AQ8f HUU6AQw15OYfoCjTGQKQNzVUT2zimN8+WBWE5jM02tMyjI69kWuEykuEbMP2gh9ysGSkNM vVKfLTTWlZe32/grr1ezgM/uRL0GY/TlpO6Ij4qGXVKLEE7K177eT36V9URhhcCV2i6pyR iIa/IZpTLzwci+OBgDDsr31ZYCntBChUFgmPRBOTqCS1op35SSKKlVPY11AVmjg38G6e5b z8LeX9oP5kt4Bcca1SCGLC24bx74dSH4L5gHcFnDrm8B/CUPpQSCiK5Uu4kZWQ== 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 037F01BFD4; Mon, 13 Jun 2022 19:33: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 25DJXW1W023612; Mon, 13 Jun 2022 19:33:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25DJXWKa023611; Mon, 13 Jun 2022 19:33:32 GMT (envelope-from git) Date: Mon, 13 Jun 2022 19:33:32 GMT Message-Id: <202206131933.25DJXWKa023611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: dd883e9a7e80 - main - weed_inhib(): correct the condition to re-suspend a thread List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: dd883e9a7e8045d86774fa3f944b53a4f78d0fd0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655148813; 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=V6tb5o+NWXIyIi5V0xRoF5nz1MItfDTcldvC90nNSrk=; b=X2w51Afd7Bnh+9bNWKoRVu/tOo0KuFViorHlAIRRp6/RboOYW5Kt6NUtP2eRmSRd8ys8Fv GBlT35W5G/GHNjxezfOy7qlYq8AUEvgC0mR3l0WTaXi7Pxeao5xBS8jWpqRM2FAyIPss8z bZvlVNccUOh70lTs+HEH3tBTTcsiR/J9a+wQPlkJ77Aez9bvVQJj7LyJDrfi+wBMBn1lzR JqTBvcVsoKL8q6ab6ZIcT4ROUnyqqseIwloIe0XqYBGwauQQq1XTOTCPBbMB83T5guSKth ejo9y5dBra49MzcPC/DRYLjhF2QPHZTci0meJHpft26Pqp+1KtR/dKWRCE8zIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655148813; a=rsa-sha256; cv=none; b=WLJpZyAlkalsspt+rkK23Iag9c4DWSIhkfvG1y59wPbE34Nry3hYNrDBSdnHKbN5TFq8xm ATtzQX+iZktMf1ICkA62IRC83ySoFGZJSY4uyheaS8qXk/Md14ipgc5dCd19VsouTet3Ga h8iiQ07HmTrwSent2uOP4UltVx2VKWVKntSJUo1m+ntQ9sX+sKxxk3x8l8cjcRJehdOiHF 4tlK43s36WzXPdnUeaF/vgd3jZcHE/Rkz8/ywHfiLT+MEYbGhFDPbyhvOgN9FFGC71217n J6FboQqT43vhgiV5VY+0edDX4aBfoPvmwfo+HFAwM4Xp7X6/IbI/7Xj914QzLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dd883e9a7e8045d86774fa3f944b53a4f78d0fd0 commit dd883e9a7e8045d86774fa3f944b53a4f78d0fd0 Author: Konstantin Belousov AuthorDate: 2022-05-10 23:37:58 +0000 Commit: Konstantin Belousov CommitDate: 2022-06-13 19:30:03 +0000 weed_inhib(): correct the condition to re-suspend a thread suspended for SINGLE_ALLPROC mode. There is no need to check for boundary state. It is only required to see that the suspension comes from the ALLPROC mode. In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D35310 --- 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 1247d842beb1..de04fee8cb96 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1144,25 +1144,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: