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
This commit is contained in:
Mark Johnston 2022-03-01 08:55:43 -05:00
parent 9340d69e57
commit 89ae8eb74e

View File

@ -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();