aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_pagequeue.h
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2018-03-22 19:21:11 +0000
committerJeff Roberson <jeff@FreeBSD.org>2018-03-22 19:21:11 +0000
commit5c930c894dad3d587fe7ff3c9abc496b5379d536 (patch)
tree1983f1c520172dec42bf2d0103e3c860caeb4fea /sys/vm/vm_pagequeue.h
parent9a4b4cd3bcd466d22941bd4bd8f17fba46ea4dee (diff)
downloadsrc-5c930c894dad3d587fe7ff3c9abc496b5379d536.tar.gz
src-5c930c894dad3d587fe7ff3c9abc496b5379d536.zip
Lock reservations with a dedicated lock in each reservation. Protect the
vmd_free_count with atomics. This allows us to allocate and free from reservations without the free lock except where a superpage is allocated from the physical layer, which is roughly 1/512 of the operations on amd64. Use the counter api to eliminate cache conention on counters. Reviewed by: markj Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14707
Notes
Notes: svn path=/head/; revision=331369
Diffstat (limited to 'sys/vm/vm_pagequeue.h')
-rw-r--r--sys/vm/vm_pagequeue.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h
index b13657072717..894b4b57d31b 100644
--- a/sys/vm/vm_pagequeue.h
+++ b/sys/vm/vm_pagequeue.h
@@ -180,7 +180,7 @@ vm_pagequeue_cnt_add(struct vm_pagequeue *pq, int addend)
void vm_domain_set(struct vm_domain *vmd);
void vm_domain_clear(struct vm_domain *vmd);
-int vm_domain_available(struct vm_domain *vmd, int req, int npages);
+int vm_domain_allocate(struct vm_domain *vmd, int req, int npages);
/*
* vm_pagequeue_domain:
@@ -266,22 +266,5 @@ vm_domain_freecnt_inc(struct vm_domain *vmd, int adj)
vm_domain_clear(vmd);
}
-static inline void
-vm_domain_freecnt_dec(struct vm_domain *vmd, int adj)
-{
- u_int old, new;
-
- old = atomic_fetchadd_int(&vmd->vmd_free_count, -adj);
- new = old - adj;
- KASSERT(new >= 0, ("vm_domain_freecnt_dec: free count underflow"));
- if (vm_paging_needed(vmd, new) && !vm_paging_needed(vmd, old))
- pagedaemon_wakeup(vmd->vmd_domain);
- /* Only update bitsets on transitions. */
- if ((old >= vmd->vmd_free_min && new < vmd->vmd_free_min) ||
- (old >= vmd->vmd_free_severe && new < vmd->vmd_free_severe))
- vm_domain_set(vmd);
-}
-
-
#endif /* _KERNEL */
#endif /* !_VM_PAGEQUEUE_ */