From nobody Tue Mar 01 14:39:53 2022 X-Original-To: dev-commits-src-main@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 54BCC19DA7E3; Tue, 1 Mar 2022 14:39:54 +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 4K7Kf16ywqz3FhS; Tue, 1 Mar 2022 14:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646145594; 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=E/Y6dZU1/147TFDRuqyTn0OiWUjAAll88bQISuU+Ybg=; b=tTgfInijX3KSh8eEJOpY0FucucJOghlWSSsMbn0JYny+XzeeQX9+WiREiCF7eO0DQUvxGG 2EyBxVXOqvubKmvbjVkx3Br2Su0Vzv2be8/UB8zW90f3w3QLqJuhT4zi2pnIi48faRs1/Q ZpvzoS2lci+2Q9krKV1H9iqaTIBXbum2APVnk/pnAuD/6Ktx14V7lnt4lMJfnMFV1nUhiX DwwgZC8JuHPGp1sYzu8BniJDTa+948jV3hOkjMfHkBKOIJD+0pCtrmDBR9oxQJe+fmTlWP orgwTyKUERTnsT95BQE6RxwM/3N8czsUbvLaCJcWnEckz4Bnq/6ZLCCIhkV5ZA== 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 BC4BE1162F; Tue, 1 Mar 2022 14:39:53 +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 221EdrBX038451; Tue, 1 Mar 2022 14:39:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 221Edr4X038450; Tue, 1 Mar 2022 14:39:53 GMT (envelope-from git) Date: Tue, 1 Mar 2022 14:39:53 GMT Message-Id: <202203011439.221Edr4X038450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 89ae8eb74e87 - main - rmlock: Add required compiler barriers to _rm_runlock() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646145594; 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=E/Y6dZU1/147TFDRuqyTn0OiWUjAAll88bQISuU+Ybg=; b=VDHImjvu2GQYMGcsbn4r+ZQA5BbuDlM+FibGK1JwQ3DTE4+zhDQ3Cw+O5xK6cCP+eXpYLH IA5mLJiKy+0y+bVD30hLi9bvrT69EKTUJM2C8bLNHi7lOH+1Kanxkc7+pT3fXzEJBD3Buk ICST8tyRGucrOz4g7jDLb/eZ/uXBIdYkjbuimXjqXnCBeKkD0AFbzObpdIPr5im9nYZZEm /+QLU0mmXC0WBbu9tQprPCn5Yj9yApjgXkpov5uePo3N3OYDj4IEdnNC1ORwUsGiS37z2i +T4Brj75dNfn8HJLpFQF7PC3dlFbm9g8WmNhG0RVOh5iw2sHyMZsubT3EskBoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646145594; a=rsa-sha256; cv=none; b=VaAmodIJhCKq9GhaGSi+58e4h8BYIasbjLq8aNGtuYjYM55mWEv7+YeZWbX6DD8BhGuNPu ipeaH4Z26otbedxNzcaCKT2VQ5CCRdq9h6T92jnjOVVNiTrS5PWnBavDaGLau0Bl1fnu7V l0Cvy7z3W26zBI9DXd6AxFIyDnYP4zTcksJ3Ebuc6bJjeOcDOjrya43WYPTnfVGMzefwlW qI7MNGeECBSgBCtEk5tMneo1/NNFJDiKGz8ogVOfxhSZG8EfeJvlmPMtX5HuEE4s54sg6J bJJNSOxyd/zd20FwMXyMl2t7QgOF2FE8FmKRS/sJlhb6qMRYyDZspuptCjemxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f commit 89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f Author: Mark Johnston AuthorDate: 2022-03-01 13:55:43 +0000 Commit: Mark Johnston CommitDate: 2022-03-01 14:38:45 +0000 rmlock: Add required compiler barriers to _rm_runlock() Also remove excessive whitespace in _rm_rlock(). Reviewed by: jah, mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34381 --- sys/kern/kern_rmlock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index bbea8041360a..0cdcfb8fec62 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -449,17 +449,13 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) THREAD_NO_SLEEPING(); td->td_critnest++; /* critical_enter(); */ - atomic_interrupt_fence(); pc = get_pcpu(); - rm_tracker_add(pc, tracker); - sched_pin(); atomic_interrupt_fence(); - td->td_critnest--; /* @@ -517,8 +513,12 @@ _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker) return; td->td_critnest++; /* critical_enter(); */ + atomic_interrupt_fence(); + pc = get_pcpu(); rm_tracker_remove(pc, tracker); + + atomic_interrupt_fence(); td->td_critnest--; sched_unpin();