From nobody Wed Apr 20 11:18:12 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 5362311DB666; Wed, 20 Apr 2022 11:18:12 +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 4KjypD1gb5z4hZy; Wed, 20 Apr 2022 11:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650453492; 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=8DwLoO8ucUU5pnGaARAX//AOxBi20fO4CmhCQrLrbMg=; b=KS5BnhZxbYhgV18pTGe2z59m6r4WBTOFbI/pOpiVWwt2zvG9rfV0p4oQHi0s6D9rdmpHQu vcbjDpjV6Es367yhZyNwe8otzCSiHTomf1DeFzABsXHh8kHlG4Wb/DUNvGwvqiNIAKQoAd p+dbqqUUZDqGpwt7q3rpI0qxevyuzH2oxzNpAA68SAtOCtDe/fgj82/M94kBJU7QAl/LHW 4QbXXqKwojNknG6vwpnOtV1q9YqsyVe+F8uQF1VAXSKVY+Wg7h6mc0ObdHYpc3Dz7OMzfT TMZzTdwlRxxdxMurr3gW3SJIKSo3utAMEIMwDbuakHjeOrXq39tKCcUVB5lT7A== 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 1938F12F49; Wed, 20 Apr 2022 11:18:12 +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 23KBICcR055879; Wed, 20 Apr 2022 11:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23KBICo0055878; Wed, 20 Apr 2022 11:18:12 GMT (envelope-from git) Date: Wed, 20 Apr 2022 11:18:12 GMT Message-Id: <202204201118.23KBICo0055878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a879e40ca2a9 - main - callout: fix using shared rmlocks 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650453492; 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=8DwLoO8ucUU5pnGaARAX//AOxBi20fO4CmhCQrLrbMg=; b=M+BFAYH+LSm8YR5J/U9MbFNkNP+2K9KRGTcWTFSWAi8NUK7JEZadbEX82HrziBRgMuy0j7 1aL31BzfR6b2IjZvn0Xq390eKg06j2Qb/7WlLILGs/mfNbP4HYigAKzmVfYBilssLToLt6 gNGSpZur7fzcEm5V0hFFXhKk/aEkzfyEnJ9lTvlZrWTIh2f+g6fqCgQxUOjeTKqcWGI7Jr ELOjJP6MuFmzCG1YGhzFQYE7GH83UF1XOs4mNdhBej5YizAMWlckSCW79l653hzCSbdCEX qwUFyPHpSG9naIb5LUmv0P9BZ6Te/7jrxy3R9djs9eNx7LiYpy1QKeQI/pHqKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650453492; a=rsa-sha256; cv=none; b=LjqLprFtowra3+GQZz7i5pd3XSa3yrnyJ4CgDH9b/40nwWsgQJKk49lVCdoia0qZQmilr7 bAFhyhY2UJAE5QPGA5UJENP/Oa4y2g05M4E2Zt3D+f7ABZ+D7CWoRHSZPzD78pGDLqfHjJ ZCKoKeDseexuu/tju82V9f7sUgM2Buj/ZM+qxBrn9yCkAkwcXpmiZM+3SbI2Hf4EFfm7YG XnZQMm29KKX6qveeTVyR8v2KnMI8QitrAsattIpXAvDIAWWI06Bvf32QXy3n/ryT0WxI+X LI0MGz+kIE8jf3KTtzILSJDc7stbCqefkxXTXvtwCGvwoVuI4ygorE9ECGQ4WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3 commit a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3 Author: Kristof Provost AuthorDate: 2022-04-19 15:01:25 +0000 Commit: Kristof Provost CommitDate: 2022-04-20 11:06:50 +0000 callout: fix using shared rmlocks 15b1eb142c changed the callout code to store the CALLOUT_SHAREDLOCK flag in c_iflags (where it used to be c_flags), but failed to update the check in softclock_call_cc(). This resulted in the callout code always taking the write lock, even if a read lock had been requested (with the CALLOUT_SHAREDLOCK flag in callout_init_rm()). Reviewed by: markj MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34959 --- sys/kern/kern_timeout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 839c6d84a9ec..db4217114c35 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -666,7 +666,7 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc, ("softclock_call_cc: act %p %x", c, c->c_flags)); class = (c->c_lock != NULL) ? LOCK_CLASS(c->c_lock) : NULL; lock_status = 0; - if (c->c_flags & CALLOUT_SHAREDLOCK) { + if (c->c_iflags & CALLOUT_SHAREDLOCK) { if (class == &lock_class_rm) lock_status = (uintptr_t)&tracker; else