Date: Fri, 24 Jun 2022 19:36:59 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 36f99db22bff - stable/13 - weed_inhib(): correct the condition to re-suspend a thread Message-ID: <202206241936.25OJax24084260@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=36f99db22bff11c1ec3290d18fba15534fd348a3 commit 36f99db22bff11c1ec3290d18fba15534fd348a3 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-05-10 23:37:58 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206241936.25OJax24084260>