]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Start implementing queue state updates using fcmpset loops.
authorMark Johnston <markj@FreeBSD.org>
Sat, 28 Dec 2019 19:03:32 +0000 (19:03 +0000)
committerMark Johnston <markj@FreeBSD.org>
Sat, 28 Dec 2019 19:03:32 +0000 (19:03 +0000)
commitf3f38e2580f1e721c6112a8f7103855330fa203c
tree77f711273c181050248b0c51f13792af4e284a45
parent3c01c56b0e25bb395799130025f47f92ed19dca7
Start implementing queue state updates using fcmpset loops.

This is in preparation for eliminating the use of the vm_page lock for
protecting queue state operations.

Introduce the vm_page_pqstate_commit_*() functions.  These functions act
as helpers around vm_page_astate_fcmpset() and are specialized for
specific types of operations.  vm_page_pqstate_commit() wraps these
functions.

Convert a number of routines to use these new helpers.  Use
vm_page_release_toq() in vm_page_unwire() and vm_page_release() to
atomically release a wiring reference and release the page into a queue.
This has the side effect that vm_page_unwire() will leave the page in
the active queue if it is already present there.

Convert the page queue scans to use the new helpers.  Simplify
vm_pageout_reinsert_inactive(), which requeues pages that were found to
be busy during an inactive queue scan, to avoid duplicating the work of
vm_pqbatch_process_page().  In particular, if PGA_REQUEUE or
PGA_REQUEUE_HEAD is set, let that be handled during batch processing.

Reviewed by: jeff
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D22770
Differential Revision: https://reviews.freebsd.org/D22771
Differential Revision: https://reviews.freebsd.org/D22772
Differential Revision: https://reviews.freebsd.org/D22773
Differential Revision: https://reviews.freebsd.org/D22776
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c