git: 4a80132dcd48 - stable/13 - rmlock: Temporarily revert commit c84bb8cd771c

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 07 Mar 2022 15:47:25 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=4a80132dcd48d6dc8802ead5b38a52ab24f72785

commit 4a80132dcd48d6dc8802ead5b38a52ab24f72785
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-03-07 15:35:59 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-03-07 15:45:24 +0000

    rmlock: Temporarily revert commit c84bb8cd771c
    
    It appears to have introduced a regression on arm64, possibly due to the
    fact that the pcpu pointer is reloaded outside of the critical section
    in _rm_rlock().  Until this is resolved one way or another, let's
    revert.
    
    Reported by:    Ronald Klop <ronald-lists@klop.ws>
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit afb44cb01018eb1363cb4ee20a31534b844d00f7)
---
 sys/kern/kern_rmlock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c
index bbea8041360a..66a035554b17 100644
--- a/sys/kern/kern_rmlock.c
+++ b/sys/kern/kern_rmlock.c
@@ -452,7 +452,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
 
 	atomic_interrupt_fence();
 
-	pc = get_pcpu();
+	pc = cpuid_to_pcpu[td->td_oncpu];
 
 	rm_tracker_add(pc, tracker);
 
@@ -517,7 +517,7 @@ _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker)
 		return;
 
 	td->td_critnest++;	/* critical_enter(); */
-	pc = get_pcpu();
+	pc = cpuid_to_pcpu[td->td_oncpu];
 	rm_tracker_remove(pc, tracker);
 	td->td_critnest--;
 	sched_unpin();