mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 10:01:02 +01:00
vm_page: add vm_page_clearref() helper
It is supposed to be used for ref_count manipulations when the pages are owned by an object, but ref_count is used for something else than the wiring, e.g. PTE population count on the page table page. Reviewed by: markj Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45910
This commit is contained in:
parent
ec1b18c735
commit
45cde0e439
@ -947,6 +947,17 @@ vm_page_in_laundry(vm_page_t m)
|
||||
return (queue == PQ_LAUNDRY || queue == PQ_UNSWAPPABLE);
|
||||
}
|
||||
|
||||
static inline void
|
||||
vm_page_clearref(vm_page_t m)
|
||||
{
|
||||
u_int r;
|
||||
|
||||
r = m->ref_count;
|
||||
while (atomic_fcmpset_int(&m->ref_count, &r, r & (VPRC_BLOCKED |
|
||||
VPRC_OBJREF)) == 0)
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_page_drop:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user