PERFORCE change 89546 for review
Kip Macy
kmacy at FreeBSD.org
Wed Jan 11 23:19:19 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=89546
Change 89546 by kmacy at kmacy:freebsd7_xen3 on 2006/01/12 07:18:18
in contigmalloc / contigfree add in functions for creating physically (in machine pages)
contiguous extents
Affected files ...
.. //depot/projects/xen3/src/sys/vm/vm_contig.c#2 edit
Differences ...
==== //depot/projects/xen3/src/sys/vm/vm_contig.c#2 (text+ko) ====
@@ -562,6 +562,7 @@
vm_page_t pages;
vm_pindex_t npgs;
+ /* XXXEN should consider rounding to nearest power of two */
npgs = round_page(size) >> PAGE_SHIFT;
mtx_lock(&Giant);
if (vm_old_contigmalloc) {
@@ -573,6 +574,14 @@
if (pages == NULL) {
ret = NULL;
} else {
+#ifdef XEN
+ /* make the logically contiguous pages - physically contiguous in
+ * memory - note that we do not in fact need the pages to be logically
+ * contiguous, but I am leaving it as is for now for the sake of
+ * expediency - kmacy
+ */
+ xen_create_contiguous_region(pages, npgs);
+#endif
ret = contigmalloc2(pages, npgs, flags);
if (ret == NULL)
vm_page_release_contig(pages, npgs);
@@ -590,6 +599,9 @@
vm_pindex_t npgs;
npgs = round_page(size) >> PAGE_SHIFT;
+#ifdef XEN
+ xen_destroy_contiguous_region(addr, npgs);
+#endif
kmem_free(kernel_map, (vm_offset_t)addr, size);
malloc_type_freed(type, npgs << PAGE_SHIFT);
}
More information about the p4-projects
mailing list