svn commit: r248428 - in user/attilio/vmcontention/sys: amd64/amd64 i386/i386 vm
Alan Cox
alc at FreeBSD.org
Sun Mar 17 16:06:05 UTC 2013
Author: alc
Date: Sun Mar 17 16:06:03 2013
New Revision: 248428
URL: http://svnweb.freebsd.org/changeset/base/248428
Log:
Simplify the interface to vm_radix_insert() by eliminating the parameter
"index". The content of a radix tree leaf, or at least its "key", is not
opaque to the other radix tree operations. Specifically, they know how to
extract the "key" from a leaf. So, eliminating the parameter "index" isn't
breaking the abstraction. Moreover, eliminating the parameter "index"
effectively prevents the caller from passing an inconsistent "index" and
leaf to vm_radix_insert().
Reviewed by: attilio
Sponsored by: EMC / Isilon Storage Division
Modified:
user/attilio/vmcontention/sys/amd64/amd64/pmap.c
user/attilio/vmcontention/sys/i386/i386/pmap.c
user/attilio/vmcontention/sys/vm/vm_page.c
user/attilio/vmcontention/sys/vm/vm_radix.c
user/attilio/vmcontention/sys/vm/vm_radix.h
Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c
==============================================================================
--- user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sun Mar 17 15:59:44 2013 (r248427)
+++ user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sun Mar 17 16:06:03 2013 (r248428)
@@ -1533,7 +1533,7 @@ pmap_insert_pt_page(pmap_t pmap, vm_page
{
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- vm_radix_insert(&pmap->pm_root, mpte->pindex, mpte);
+ vm_radix_insert(&pmap->pm_root, mpte);
}
/*
Modified: user/attilio/vmcontention/sys/i386/i386/pmap.c
==============================================================================
--- user/attilio/vmcontention/sys/i386/i386/pmap.c Sun Mar 17 15:59:44 2013 (r248427)
+++ user/attilio/vmcontention/sys/i386/i386/pmap.c Sun Mar 17 16:06:03 2013 (r248428)
@@ -1609,7 +1609,7 @@ pmap_insert_pt_page(pmap_t pmap, vm_page
{
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- vm_radix_insert(&pmap->pm_root, mpte->pindex, mpte);
+ vm_radix_insert(&pmap->pm_root, mpte);
}
/*
Modified: user/attilio/vmcontention/sys/vm/vm_page.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_page.c Sun Mar 17 15:59:44 2013 (r248427)
+++ user/attilio/vmcontention/sys/vm/vm_page.c Sun Mar 17 16:06:03 2013 (r248428)
@@ -836,7 +836,7 @@ vm_page_insert(vm_page_t m, vm_object_t
} else
TAILQ_INSERT_TAIL(&object->memq, m, listq);
}
- vm_radix_insert(&object->rtree, pindex, m);
+ vm_radix_insert(&object->rtree, m);
/*
* Show that the object has one more resident page.
@@ -1113,7 +1113,7 @@ vm_page_cache_transfer(vm_object_t orig_
/* Update the page's object and offset. */
m->object = new_object;
m->pindex -= offidxstart;
- vm_radix_insert(&new_object->cache, m->pindex, m);
+ vm_radix_insert(&new_object->cache, m);
}
mtx_unlock(&vm_page_queue_free_mtx);
}
@@ -2187,7 +2187,7 @@ vm_page_cache(vm_page_t m)
m->flags |= PG_CACHED;
cnt.v_cache_count++;
cache_was_empty = vm_radix_is_empty(&object->cache);
- vm_radix_insert(&object->cache, m->pindex, m);
+ vm_radix_insert(&object->cache, m);
#if VM_NRESERVLEVEL > 0
if (!vm_reserv_free_page(m)) {
#else
Modified: user/attilio/vmcontention/sys/vm/vm_radix.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_radix.c Sun Mar 17 15:59:44 2013 (r248427)
+++ user/attilio/vmcontention/sys/vm/vm_radix.c Sun Mar 17 16:06:03 2013 (r248428)
@@ -373,16 +373,15 @@ vm_radix_init(void)
* Panics if the key already exists.
*/
void
-vm_radix_insert(struct vm_radix *rtree, vm_pindex_t index, vm_page_t page)
+vm_radix_insert(struct vm_radix *rtree, vm_page_t page)
{
- vm_pindex_t newind;
+ vm_pindex_t index, newind;
struct vm_radix_node *rnode, *tmp, *tmp2;
vm_page_t m;
int slot;
uint16_t clev;
- KASSERT(index == page->pindex, ("%s: index != page->pindex",
- __func__));
+ index = page->pindex;
/*
* The owner of record for root is not really important because it
Modified: user/attilio/vmcontention/sys/vm/vm_radix.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_radix.h Sun Mar 17 15:59:44 2013 (r248427)
+++ user/attilio/vmcontention/sys/vm/vm_radix.h Sun Mar 17 16:06:03 2013 (r248428)
@@ -35,8 +35,7 @@
#ifdef _KERNEL
void vm_radix_init(void);
-void vm_radix_insert(struct vm_radix *rtree, vm_pindex_t index,
- vm_page_t page);
+void vm_radix_insert(struct vm_radix *rtree, vm_page_t page);
vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index);
vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index);
vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index);
More information about the svn-src-user
mailing list