Date: Mon, 21 Mar 2022 23:56:24 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: fd6ca665d206 - main - Fix umtxq_sleep() regression caused by 56070dd2e4d. Message-ID: <202203212356.22LNuOms064820@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=fd6ca665d206b74970e7c01d06ae06fed71500fc commit fd6ca665d206b74970e7c01d06ae06fed71500fc Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2022-03-21 23:43:39 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2022-03-21 23:55:55 +0000 Fix umtxq_sleep() regression caused by 56070dd2e4d. umtxq_requeue() moves the queue to a different hash chain and different lock, so we can't rely on msleep_sbt() reacquiring the same old lock. We have to use PDROP and update the queue chain and so lock pointer. PR: 262587 MFC after: 2 weeks --- sys/kern/kern_umtx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index b864e6fe9e49..7f74ba68b59c 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -808,8 +808,10 @@ umtxq_sleep(struct umtx_q *uq, const char *wmesg, if (error != 0) break; } - error = msleep_sbt(uq, &uc->uc_lock, PCATCH, wmesg, + error = msleep_sbt(uq, &uc->uc_lock, PCATCH | PDROP, wmesg, sbt, 0, flags); + uc = umtxq_getchain(&uq->uq_key); + mtx_lock(&uc->uc_lock); if (error == EINTR || error == ERESTART) break; if (error == EWOULDBLOCK && (flags & C_ABSOLUTE) != 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203212356.22LNuOms064820>