From nobody Mon Oct 17 23:46:33 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 4Mrttd52qgz4g4Ym; Mon, 17 Oct 2022 23:46: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 4Mrttd4Tzsz4PY7; Mon, 17 Oct 2022 23:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666050393; 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=qLBt0kQpaaQ12Xj94MUnaGlWCmg6f9BcdYrXtrZ2VTQ=; b=yWgJiOUCuINUX7bqsVO2L42OdNCHMmND0EV+AmpuxsFfroUwy3Wu7NHAz/7nUSeZITYD4z 5TkbVRaKmWzJqMvcMOTBEBdIGEhCGHfwcVqk4aduzBy0qoIi6UiuFH+bs5An05e69aLN4M XpFr4AbM5tdlbT/eAxLyBSbZnOzgylcPCfJUSngDNsBAz2/LTm6ERgK2mUjJK+wYfWZCiz TUyDx+FCfbIQRQgosOf8xWVJY85mLjh+oi2TqJHmRu6PBtU1QPjWaUJmmHK3HW5LQQ7CAZ Eou1ctxf0aZPk3ywvFYKYUs9DYozzpfs4TzBIiIN4lhIzwXdcWUDvY1NepOinQ== 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 4Mrttd3VVQz10Wv; Mon, 17 Oct 2022 23:46: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 29HNkX6e023267; Mon, 17 Oct 2022 23:46:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HNkXba023266; Mon, 17 Oct 2022 23:46:33 GMT (envelope-from git) Date: Mon, 17 Oct 2022 23:46:33 GMT Message-Id: <202210172346.29HNkXba023266@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: 5484cd9b1dfd - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 5484cd9b1dfd0f54dd559d8e803e6bb037a28f76 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666050393; 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=qLBt0kQpaaQ12Xj94MUnaGlWCmg6f9BcdYrXtrZ2VTQ=; b=CQAtlPWuz59qzoPNkBbC24PGlk0HFMLn45o/PxVgBgWdJolzS2yrGuCEwZy6tV9JCIyWkM kDdCXdoEHKoNbv9dFjHw6uLRxDpASnxrxHsbgdGxXZ8NBjk28Ztgp5ROcXSjk2Zyd8X51J uN7wrHB/TttjavuETylWWGMyD15N5VQ5BQeKGrl7LGdQ3Q+/3/+PMhNDdZMnwF26ma74wJ ZgkQY0v6s2u/gd3lp28Xc4nB5/urK5xkO55z7i/elit6q27gHd6qDBeix+OXWpTM4GXcyq t5cedKQhe1uHIv7T9saPNWNEzp5zBBT0ZnNX+LJrHWUe7c43Li9HdoHlRs6OjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666050393; a=rsa-sha256; cv=none; b=ayevgLBjckLCogxUS7GzYUzgCtCTi3df4INn8suWJr94zbPOCBm7LMoVBBgRK3LuLjnFXL QMSfISl/ol/bXPF0bLuL++d5bfbDEjoQIohpqxZiKrw+U5kziI9U9vW2BFK9K0YnciDbLG uShTT3nith4kFbBNVXk7Ezvkss4YIbdYVx3tQcMMQOS8jQZgAI9felafQO9ic0TljzUSUj e9w2t8cRODctjzKdXNOfkMWqN+BGWONJ1MKr4lk0rka8+a/PLZ7S5fYSDVa9V64fYu4Jg2 wWdEZ84GMtXWy/nqBVnSrUdjUYgVKrMfndfEA7N04/dihJ0SPvwxid1IIhMq/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5484cd9b1dfd0f54dd559d8e803e6bb037a28f76 commit 5484cd9b1dfd0f54dd559d8e803e6bb037a28f76 Author: Rick Macklem AuthorDate: 2022-10-14 22:46:55 +0000 Commit: Rick Macklem CommitDate: 2022-10-17 23:44:55 +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 0231c303f089..0b3cada47891 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -110,8 +110,6 @@ static 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. @@ -423,7 +421,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; }