diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:45:41 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:45:41 +0000 |
commit | 0012f373e43db2341c20329163ed2d5ad3b0f341 (patch) | |
tree | 0ee773797648995271d10676de6c8aadc464785c /sys/vm/vm_pageout.c | |
parent | 205be21d997d5becfaee5918386d4087b09f98a8 (diff) | |
download | src-0012f373e43db2341c20329163ed2d5ad3b0f341.tar.gz src-0012f373e43db2341c20329163ed2d5ad3b0f341.zip |
(4/6) Protect page valid with the busy lock.
Atomics are used for page busy and valid state when the shared busy is
held. The details of the locking protocol and valid and dirty
synchronization are in the updated vm_page.h comments.
Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21594
Notes
Notes:
svn path=/head/; revision=353539
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 2ad647c96562..7e638821cd34 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -469,7 +469,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen, * edge case with file fragments. */ for (i = 0; i < count; i++) { - KASSERT(mc[i]->valid == VM_PAGE_BITS_ALL, + KASSERT(vm_page_all_valid(mc[i]), ("vm_pageout_flush: partially invalid page %p index %d/%d", mc[i], i, count)); KASSERT((mc[i]->aflags & PGA_WRITEABLE) == 0, @@ -829,7 +829,7 @@ recheck: * Invalid pages can be easily freed. They cannot be * mapped; vm_page_free() asserts this. */ - if (m->valid == 0) + if (vm_page_none_valid(m)) goto free_page; /* @@ -1560,7 +1560,7 @@ recheck: * Invalid pages can be easily freed. They cannot be * mapped, vm_page_free() asserts this. */ - if (m->valid == 0) + if (vm_page_none_valid(m)) goto free_page; /* |