From nobody Wed Jan 26 22:28:16 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 5763D1975EEB; Wed, 26 Jan 2022 22:28:16 +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 4Jkdf81yDYz4rD4; Wed, 26 Jan 2022 22:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643236096; 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=V6VQaOJwX7L6QqlDgPkbIqSV1XqZqgdBIk+ttGShQLE=; b=C5lzb97D4c7r/ors73yzSq7nqKO0Y+3enkx2MSHtlnQCLfRgckdyyiiM8HToYXlwBbfkNA MRgOb5fIyutaIDuTBKf+2ilrDJVugVjx6A/tNGOd0gHcrQe2TS8BUySySDLGMo30LQIhNj yQjnnqiTGYM0ZLzg786j2/Mc80z4XvSciW7oPqLnjeQojg7iVjdc97pI9xlnhk42ELir2A ixdMRRnKI2M0MrwzFBda/1u9/zFwnmOih9F1Mm4KnpkqubDF6jTmtYlSunltRAIMtSilZr w3ByL4NOCCgvgeySg4OC0v0qabXyrxki0mo9B8+s5mN4S7SVgdQaQFgMbu4auA== 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 22E9D297D; Wed, 26 Jan 2022 22:28:16 +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 20QMSGfH054684; Wed, 26 Jan 2022 22:28:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20QMSG2T054683; Wed, 26 Jan 2022 22:28:16 GMT (envelope-from git) Date: Wed, 26 Jan 2022 22:28:16 GMT Message-Id: <202201262228.20QMSG2T054683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 11ef1d975f61 - main - Revert "LinuxKPI: Allow spin_lock_irqsave to be called within a critical section" 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11ef1d975f61f728a25727fcb89b340b5433713c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643236096; 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=V6VQaOJwX7L6QqlDgPkbIqSV1XqZqgdBIk+ttGShQLE=; b=ntzieIlIKcoBAlCUwYpmA0SGmtCGXJoBlUk07UxjttG/f3RWhcY5KwwjK7qpMY7eD5KXad yg6SzKGwocg6JLtOW8eAfsYQpqlisrpkuXOaagf+SDGwHm8RAlufedETT/EJKZsZZLPvzM v94+Zji+JE/RjEULbFkr/x6I8v4MiRF4wDpvqK5uf+SJOL8m19k3qheMiQY7jb9L66xQ8w J/ulY2i/o9kaeF36QxpWbSEik38xFjhcxZggIqQ+BijDNdDseDepSrcAF3FVUe9SrGW01r cw4DLaQ5HupIU85itfq3Db8siMgqnC7unH6az/uATabq78/5C78XhiYP5ckAIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643236096; a=rsa-sha256; cv=none; b=SnU1EcnGNOLSvoBIzFvKXxhZr4qotZMXHrToSB3/RGlv0aKalHQu2lJseE2K+F9aZNNMWO WrVPbeix3U5WdbqPL50OMNbmA0GAylMewwDiEiSEpXbbkFMEe6Xc+7KwqQcDNFEqWh8poU k7uk9r9Y3XYgcJKK8j1SPNthD6nMsANJv3Q8e7ArS+bAHwLWsqa6C6lfvLF6rV1i4oyVqO 1jxZ1sChBmwqfpr65AAvIWTw5f8Sw0ccMQBCTSvl5mBW9mBQn0QXRPDVn5mL6eNaDvp8hu JI1A7CSo02H4UAOTcsba5UgKGGJafU79tG7f1G1cHXx1czwEocTzUThN2+D08w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=11ef1d975f61f728a25727fcb89b340b5433713c commit 11ef1d975f61f728a25727fcb89b340b5433713c Author: Vladimir Kondratyev AuthorDate: 2022-01-26 22:27:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-01-26 22:27:01 +0000 Revert "LinuxKPI: Allow spin_lock_irqsave to be called within a critical section" This change results in deadlocks on UP systems This reverts commit 7dea0c9e6eba4dc127cd67667c81fa2c250f1024. Requested by: kib, hselasky --- .../linuxkpi/common/include/linux/spinlock.h | 27 ++++------------------ 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 31d47fa73986..a87cb7180b28 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -118,32 +117,14 @@ typedef struct { local_bh_disable(); \ } while (0) -#define __spin_trylock_nested(_l, _n) ({ \ - int __ret; \ - if (SPIN_SKIP()) { \ - __ret = 1; \ - } else { \ - __ret = mtx_trylock_flags(&(_l)->m, MTX_DUPOK); \ - if (likely(__ret != 0)) \ - local_bh_disable(); \ - } \ - __ret; \ -}) - -#define spin_lock_irqsave(_l, flags) do { \ - (flags) = 0; \ - if (unlikely(curthread->td_critnest != 0)) \ - while (!spin_trylock(_l)) {} \ - else \ - spin_lock(_l); \ +#define spin_lock_irqsave(_l, flags) do { \ + (flags) = 0; \ + spin_lock(_l); \ } while (0) #define spin_lock_irqsave_nested(_l, flags, _n) do { \ (flags) = 0; \ - if (unlikely(curthread->td_critnest != 0)) \ - while (!__spin_trylock_nested(_l, _n)) {} \ - else \ - spin_lock_nested(_l, _n); \ + spin_lock_nested(_l, _n); \ } while (0) #define spin_unlock_irqrestore(_l, flags) do { \