Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jan 2006 07:19:18 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 89546 for review
Message-ID:  <200601120719.k0C7JIPW068891@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=89546

Change 89546 by kmacy@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601120719.k0C7JIPW068891>