summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-01-09 17:42:18 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-01-09 17:42:18 +0000
commit9ac5f0d02bb0fb6dd51b246e99bbe9cfdc9fe8c3 (patch)
tree7bf505b05899ff645a49e45428bee84c51970ee1 /sys/uvm
parent8abd24ecfe3247f25b4610cc877dd09bd6fab717 (diff)
Make uvm_page_lookup_freelist() simpler and faster if VM_PHYSSEG_MAX is 1.
Has been in snapshots for a short while.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_page_i.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/uvm/uvm_page_i.h b/sys/uvm/uvm_page_i.h
index 3fb83b8b857..204c76084fc 100644
--- a/sys/uvm/uvm_page_i.h
+++ b/sys/uvm/uvm_page_i.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page_i.h,v 1.19 2007/12/18 11:05:52 thib Exp $ */
+/* $OpenBSD: uvm_page_i.h,v 1.20 2008/01/09 17:42:17 miod Exp $ */
/* $NetBSD: uvm_page_i.h,v 1.14 2000/11/27 07:47:42 chs Exp $ */
/*
@@ -261,11 +261,15 @@ uvm_pagecopy(struct vm_page *src, struct vm_page *dst)
PAGE_INLINE int
uvm_page_lookup_freelist(struct vm_page *pg)
{
+#if VM_PHYSSEG_MAX == 1
+ return (vm_physmem[0].free_list);
+#else
int lcv;
lcv = vm_physseg_find(atop(VM_PAGE_TO_PHYS(pg)), NULL);
KASSERT(lcv != -1);
return (vm_physmem[lcv].free_list);
+#endif
}
#endif /* defined(UVM_PAGE_INLINE) || defined(UVM_PAGE) */