]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
rmlock: Temporarily revert commit c84bb8cd771c
authorMark Johnston <markj@FreeBSD.org>
Mon, 7 Mar 2022 15:35:59 +0000 (10:35 -0500)
committerMark Johnston <markj@FreeBSD.org>
Mon, 7 Mar 2022 15:45:24 +0000 (10:45 -0500)
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

index bbea8041360a8a200d3aa44f438d0fb5525a4651..66a035554b1712aeef1947b3d3b9424092d2f4ed 100644 (file)
@@ -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();