git: 40e9da8c6b64 - stable/13 - rmlock: Add required compiler barriers to _rm_runlock()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 14 Mar 2022 14:46:04 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=40e9da8c6b6453f7a26737c64e3de9da11f9f8a4
commit 40e9da8c6b6453f7a26737c64e3de9da11f9f8a4
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-03-01 13:55:43 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-03-14 14:45:06 +0000
rmlock: Add required compiler barriers to _rm_runlock()
Also remove excessive whitespace in _rm_rlock().
Reviewed by: jah, mjg
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f)
---
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 66a035554b17..d7dea8efc40e 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 = cpuid_to_pcpu[td->td_oncpu];
-
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 = cpuid_to_pcpu[td->td_oncpu];
rm_tracker_remove(pc, tracker);
+
+ atomic_interrupt_fence();
td->td_critnest--;
sched_unpin();