summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_amap_i.h
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-10 14:51:22 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-10 14:51:22 +0000
commit6dfd3edcfce606fdcb05dd53327f33921ec6e477 (patch)
treef15c90a6f1a1449770e6568558f15d2bda50f7f7 /sys/uvm/uvm_amap_i.h
parent00c7bfc86077f60d16b11baf228c6b68f1675106 (diff)
More sync to NetBSD.
The highlight is some more advices to madvise(2). o MADV_DONTNEED will deactive the pages in the given range giving a quicker reuse. o MADV_FREE will garbage-collect the pages and swap resources causing the next fault to either page in new pages from backing store (mapped vnode) or allocate new zero-fill pages (anonymous mapping).
Diffstat (limited to 'sys/uvm/uvm_amap_i.h')
-rw-r--r--sys/uvm/uvm_amap_i.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/uvm/uvm_amap_i.h b/sys/uvm/uvm_amap_i.h
index 14398330016..bc8f43e3fb6 100644
--- a/sys/uvm/uvm_amap_i.h
+++ b/sys/uvm/uvm_amap_i.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_amap_i.h,v 1.7 2001/03/22 03:05:54 smart Exp $ */
-/* $NetBSD: uvm_amap_i.h,v 1.12 1999/03/25 18:48:49 mrg Exp $ */
+/* $OpenBSD: uvm_amap_i.h,v 1.8 2001/05/10 14:51:21 art Exp $ */
+/* $NetBSD: uvm_amap_i.h,v 1.13 1999/07/07 05:31:40 thorpej Exp $ */
/*
*
@@ -114,7 +114,7 @@ amap_lookups(aref, offset, anons, npages)
* pmap_page_protect on the anon's page.
* => returns an "offset" which is meaningful to amap_unadd().
*/
-AMAP_INLINE vaddr_t
+AMAP_INLINE void
amap_add(aref, offset, anon, replace)
struct vm_aref *aref;
vaddr_t offset;
@@ -156,23 +156,25 @@ amap_add(aref, offset, anon, replace)
UVMHIST_LOG(maphist,
"<- done (amap=0x%x, offset=0x%x, anon=0x%x, rep=%d)",
amap, offset, anon, replace);
-
- return(slot);
}
/*
- * amap_unadd: remove a page from an amap, given we know the slot #.
+ * amap_unadd: remove a page from an amap
*
* => caller must lock amap
*/
AMAP_INLINE void
-amap_unadd(amap, slot)
- struct vm_amap *amap;
- vaddr_t slot;
+amap_unadd(aref, offset)
+ struct vm_aref *aref;
+ vaddr_t offset;
{
- int ptr;
+ int ptr, slot;
+ struct vm_amap *amap = aref->ar_amap;
UVMHIST_FUNC("amap_unadd"); UVMHIST_CALLED(maphist);
+ AMAP_B2SLOT(slot, offset);
+ slot += aref->ar_pageoff;
+
if (slot >= amap->am_nslot)
panic("amap_unadd: offset out of range");