From nobody Sat Nov 12 12:41:43 2022 X-Original-To: dev-commits-src-all@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 4N8ZvX0cRzz4ffV6; Sat, 12 Nov 2022 12:41:44 +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 4N8ZvW6vl1z3spr; Sat, 12 Nov 2022 12:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668256904; 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=zovr6RW+BCsPyYfcmaFAQEcc6T/LXiO3UPl+9PfCfio=; b=YrtVj6l5MPfkqUgZSQAg9DjDhOJSIfVATaxDL0lbSCDRrjGEX3gCtkRTO83NRws5wJ0DcW cIdw455Kj3n7upu4jNU3V5fyRuThJsDTUMW6Im9ESe+9m/s9GR8vCye+N2alrXCEg5RzlB tD5kuxkzMtLbI13K40cxTtFwNX1x1XwdDvZqY2Avnv63z6ux6kkIbGQe+71EHIs80r6WuS haoGOW7XLHKs+oikSUEuIeQFhbAz93vSAdjNSLvMqYSDcADGfbG2IoM7IO8CiNP9LwEMNu 3eZeHq/Zioy5aVCyf4mxQlEz6c+I7QwwWtb4pSZrer4117KxhguuOThtU6ahHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668256904; 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=zovr6RW+BCsPyYfcmaFAQEcc6T/LXiO3UPl+9PfCfio=; b=m+wj9DZSERgqjJREmuDRsjzveU3wTPlmZUIPktFciQKzVabUdHtEiTmcSg10XVqWo/l3QI j98wnnaLmRokt8GJr+kCn12aqhenLlGS95sI86lP4BY3OVw1ZzBu1RA+BmhX2XH1Mw7227 /QdSC7gVOv9c5vSdZgHYfQk2Csvey9BcCd2QIAyFyCw7J7OFR0kIgjMGYKezcJHC3bUNxK iwIXPbQ0PyCBJzy91GUL5f2EEAnB4+t2iwtrcttHcG3BfHf2URR1zOjUO6cLCqDgHkyUXJ PthALIVc2HxT8Zr3Oj2Kh2Fc3FWr+fLOph6vBd5XbvyJu6rWhq6xXbis3FGO6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668256904; a=rsa-sha256; cv=none; b=WPGrH4FFuuloLfZm4Qqsc7lUO2bvgRTfi39HjX9cGOkWIvRR5+hQ4FgfaoQ3KAQUlB2ICo /nJsDFfbclLBz7h7wgb8NEQ4kr9RVq44Iycx0wVOED/lrs9FcUeso5iYvUHFrtF7oHIeDf uDDnluXt9QF1Cy/GN2xS/XBtOvlGB5z/BJDyml9n4tJ+hD/vm6Dh5FW3n4MLvENtj7PFOv zLfXmqKbtT6UAwF7ULwHQoUPSsF/MUwmB5RvmavNLc+TfobeeoO+lyEibYxIvOh0Tmq7gB BlqBiHV+Rp17XAUZymRLivjb5kHHcqIPRt//IQEtgHJBJMRTM0NoTXYpUSmtfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N8ZvW617tzP3T; Sat, 12 Nov 2022 12:41:43 +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 2ACCfhGi054774; Sat, 12 Nov 2022 12:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ACCfhXN054773; Sat, 12 Nov 2022 12:41:43 GMT (envelope-from git) Date: Sat, 12 Nov 2022 12:41:43 GMT Message-Id: <202211121241.2ACCfhXN054773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 62e1bb424584 - stable/13 - Fix umtxq_sleep() regression caused by 56070dd2e4d. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 62e1bb424584ca6a46e6224801d25b9fc6ca5ef9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=62e1bb424584ca6a46e6224801d25b9fc6ca5ef9 commit 62e1bb424584ca6a46e6224801d25b9fc6ca5ef9 Author: Alexander Motin AuthorDate: 2022-03-21 23:43:39 +0000 Commit: Hans Petter Selasky CommitDate: 2022-11-12 11:59:27 +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 (cherry picked from commit fd6ca665d206b74970e7c01d06ae06fed71500fc) --- 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 398ee23c5148..8a0b140c2794 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) {