aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2019-07-29 22:01:28 +0000
committerMark Johnston <markj@FreeBSD.org>2019-07-29 22:01:28 +0000
commit98549e2dc6fb0c38fef2a5357b10c4eb99674d9d (patch)
tree936bb59b20e13c4792fdc1b407ad6aee087773c8 /sys/vm/vm_page.h
parent724450761630cc0b3d8991ec2de00a8ceb507384 (diff)
Centralize the logic in vfs_vmio_unwire() and sendfile_free_page().
Both of these functions atomically unwire a page, optionally attempt to free the page, and enqueue or requeue the page. Add functions vm_page_release() and vm_page_release_locked() to perform the same task. The latter must be called with the page's object lock held. As a side effect of this refactoring, the buffer cache will no longer attempt to free mapped pages when completing direct I/O. This is consistent with the handling of pages by sendfile(SF_NOCACHE). Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20986
Notes
svn path=/head/; revision=350431
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r--sys/vm/vm_page.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 3edde63abb9b..58f181d599c5 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -562,8 +562,12 @@ bool vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low,
bool vm_page_reclaim_contig_domain(int domain, int req, u_long npages,
vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary);
void vm_page_reference(vm_page_t m);
+#define VPR_TRYFREE 0x01
+#define VPR_NOREUSE 0x02
+void vm_page_release(vm_page_t m, int flags);
+void vm_page_release_locked(vm_page_t m, int flags);
bool vm_page_remove(vm_page_t);
-int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t);
+int vm_page_rename(vm_page_t, vm_object_t, vm_pindex_t);
vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object,
vm_pindex_t pindex);
void vm_page_requeue(vm_page_t m);
@@ -574,7 +578,6 @@ void vm_page_set_valid_range(vm_page_t m, int base, int size);
int vm_page_sleep_if_busy(vm_page_t m, const char *msg);
vm_offset_t vm_page_startup(vm_offset_t vaddr);
void vm_page_sunbusy(vm_page_t m);
-bool vm_page_try_to_free(vm_page_t m);
int vm_page_trysbusy(vm_page_t m);
void vm_page_unhold_pages(vm_page_t *ma, int count);
void vm_page_unswappable(vm_page_t m);