From nobody Mon Oct 17 23:39:42 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 4Mrtkl0xLJz4g3mc; Mon, 17 Oct 2022 23:39:43 +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 4Mrtkl0D6Xz4P8c; Mon, 17 Oct 2022 23:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666049983; 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=RcugBS3RctAEXSgm6ksR5xUW35HwpmBg7gEpYIp+Nvg=; b=XMHILgSQZqn9lLSgGpsW+1cjscp93adBJ1M/gAPcSyRmAptFYKiqztI1ExuqIFyTUAetoD Gdxyq+/1ULavS0aUH5JfJeXLz38PWGUoyZgX1e8X5Ozi46iPA3q8VrLJSySlRJaUTtiLLB /KNWeE8PXepOrzkK+vEqc+Z1phU/hErYGCrU7HGtYgZrsbVaGybgpicy8PCdRpsarnc7/7 GdIxsn21w3H+fwBF6G1/DEFew4nFPc0dMPft4nG6RqGSohJEwlbIOAqz8tzdJJAG0e8/m+ 6QDL4HPNsGWNS48CnIV8Ewz81Pt6aGHnLzUpTFavyuIsB4FZnp3U2cMofiL6jw== 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 4Mrtkk6LXcz10YQ; Mon, 17 Oct 2022 23:39:42 +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 29HNdgOD010695; Mon, 17 Oct 2022 23:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HNdgj2010694; Mon, 17 Oct 2022 23:39:42 GMT (envelope-from git) Date: Mon, 17 Oct 2022 23:39:42 GMT Message-Id: <202210172339.29HNdgj2010694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9f4b854c028b - stable/13 - clnt_vc.c: Replace msleep() with pause() to avoid assert panic 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9f4b854c028b5b0395848683388fa78bd569405a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666049983; 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=RcugBS3RctAEXSgm6ksR5xUW35HwpmBg7gEpYIp+Nvg=; b=dy6mAyh17FClGrme06QTqI+nWUsRSbeqeRz5aZmmVHZg8BYwl1krHsXCPt0tnGSzVjtLoO hJpDNEQiOnWV3ehmhr3oprDpcn8IEPcfbnwYgk+IGTu4VTo5PCPvzn7r74eIwjxuGEw5TY NESC8xvFlOAmZPfx1TiZKOEHhdjVAgaF+yLmrSMR9l+3jIXGRMKJIH8huzZvsXRlrXpjgo 3FyBLiHeH0PbFcRv89MfvoMGfZJ9OIe5e2z7cm8ssWU1iehxoYJHca+gOBJAM1n6zLQuwL Gi94/TDvpxiNm957dTTTtq2lOh+4CYZXx1OROW63y1zEhVh5nOKTwbYkBEdYzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666049983; a=rsa-sha256; cv=none; b=MFkKmFndzA6oTm+/P2bpVpBzi/BUMZydgOyzHHWdLMOlDAS9oQFL7jzpMzQ45z4qclQNnx 9+FzdPKXxmfNs0SJyaP+MukWDfGS2/RJOQTbMR1Qmw+X69/vsaXnxJ+bGOoydgg1VUOZSZ voQbQzU7myhPKqM+IRjy5ryw+4EC6d/boZ1b76Ky23HW3780NAr0vTDrz/nBqJSmSRh6iT nhYCotzgtmlU4FihhdZpIjqVh+LYS4mQalKkBEt2XXz8YozWhCUAK7K4kryGoCFd2NkRE+ MvESNTnvXqvFYvv2QST9Ew6d+HbGMCzFISSUNadkZPdl5aqgdc9YJw4ZPzPJPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9f4b854c028b5b0395848683388fa78bd569405a commit 9f4b854c028b5b0395848683388fa78bd569405a Author: Rick Macklem AuthorDate: 2022-10-14 22:46:55 +0000 Commit: Rick Macklem CommitDate: 2022-10-17 23:38:39 +0000 clnt_vc.c: Replace msleep() with pause() to avoid assert panic An msleep() in clnt_vc.c used a global "fake_wchan" wchan argument along with the mutex in a CLIENT structure. As such, it was possible to use different mutexes for the same wchan and cause a panic assert. Since this is in a rarely executed code path, the assert panic was only recently observed. Since "fake_wchan" never gets a wakeup, this msleep() can be replaced with a pause() to avoid the panic assert, which is what this patch does. (cherry picked from commit 82512c17ea39fcc272483024cb55d567dfd55366) --- sys/rpc/clnt_vc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 8dab2db49dbc..d6b4f918cf8f 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -116,8 +116,6 @@ static const struct clnt_ops clnt_vc_ops = { static void clnt_vc_upcallsdone(struct ct_data *); -static int fake_wchan; - /* * Create a client handle for a connection. * Default options are set, which the user can change using clnt_control()'s. @@ -453,7 +451,9 @@ call_again: mtx_lock(&ct->ct_lock); TAILQ_REMOVE(&ct->ct_pending, cr, cr_link); /* Sleep for 1 clock tick before trying the sosend() again. */ - msleep(&fake_wchan, &ct->ct_lock, 0, "rpclpsnd", 1); + mtx_unlock(&ct->ct_lock); + pause("rpclpsnd", 1); + mtx_lock(&ct->ct_lock); goto call_again; }