HomeFreeBSD

vm_reserv: Fix list locking in vm_reserv_reclaim_contig()

Description

vm_reserv: Fix list locking in vm_reserv_reclaim_contig()

The per-domain partpop queue is locked by the combination of the
per-domain lock and individual reservation mutexes.
vm_reserv_reclaim_contig() scans the queue looking for partially
populated reservations that can be reclaimed in order to satisfy the
caller's allocation.

During the scan, we drop the per-domain lock. At this point, the rvn
pointer may be invalidated. Take care to load rvn after re-acquiring
the per-domain lock.

While here, simplify the condition used to check whether a reservation
was dequeued while the per-domain lock was dropped.

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

(cherry picked from commit 968079f253c11433d47bece4b41b46fcbf985903)

Details

Provenance
markjAuthored on Mar 11 2021, 3:34 PM
Reviewer
alc
Differential Revision
D29203: vm_reserv: Fix list locking in vm_reserv_reclaim_contig()
Parents
rG8aafa7a02763: Flush remaining routes from the routing table during VNET shutdown.
Branches
Unknown
Tags
Unknown