HomeFreeBSD

vm_page_xbusy_claim(): Use atomics to update busy lock state.

Description

vm_page_xbusy_claim(): Use atomics to update busy lock state.

vm_page_xbusy_claim() could clobber the waiter bit. For its original
use, kernel memory pages, this was not a problem since nothing would
ever block on the busy lock for such pages. r363607 introduced a new
use where this could in principle be a problem.

Fix the problem by using atomic_cmpset to update the lock owner. Since
this macro is defined only for INVARIANTS kernels the extra overhead
doesn't seem prohibitive.

Reported by: vangyzen
Reviewed by: alc, kib, vangyzen
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25859

Details

Committed
markjJul 28 2020, 7:50 PM
Reviewer
alc
Differential Revision
D25859: vm_page_xbusy_claim(): Use atomics to update busy lock state.
Parents
rS363653: Make lex a bootstrap tool when cross-building on recent 13-CURRENT.
Branches
Unknown
Tags
Unknown