Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2002 20:00:58 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 21688 for review
Message-ID:  <200211300400.gAU40wMR013324@repoman.freebsd.org>

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

Change 21688 by marcel@marcel_nfs on 2002/11/29 20:00:13

	Make the handling of sparse physical memory conditional. At this
	time it causes instability in form of failing processes and
	kernel panics triggered by passing (region 7) virtual addresses
	to vm_page_from_phys or addresses that are not covered by
	phys_avail.
	This clearly needs more thought and testing...

Affected files ...

.. //depot/projects/ia64/sys/vm/vm_page.c#27 edit
.. //depot/projects/ia64/sys/vm/vm_page.h#19 edit

Differences ...

==== //depot/projects/ia64/sys/vm/vm_page.c#27 (text+ko) ====

@@ -150,6 +150,7 @@
 		panic("vm_set_page_size: page size not a power of two");
 }
 
+#ifdef SPARSE_PHYSICAL_MEMORY
 /*
  *	vm_page_from_phys
  *
@@ -170,6 +171,7 @@
 	panic("vm_page_from_phys: unmanaged physical address.");
 	return (0);
 }
+#endif
 
 /*
  *	vm_page_startup:
@@ -254,12 +256,16 @@
 	 * page).
 	 */
 	first_page = phys_avail[0] / PAGE_SIZE;
+#ifdef SPARSE_PHYSICAL_MEMORY
 	/*
 	 * Don't use the pysical address range for the actual page range.
 	 * On architectures with sparse memory addressing this is wrong.
 	 * Instead, use the total memory obtained above.
 	 */
 	page_range = total / PAGE_SIZE;
+#else
+	page_range = phys_avail[(nblocks-1) * 2 + 1] / PAGE_SIZE - first_page;
+#endif
 	npages = (total - (page_range * sizeof(struct vm_page)) -
 	    (end - new_end)) / PAGE_SIZE;
 	end = new_end;

==== //depot/projects/ia64/sys/vm/vm_page.h#19 (text+ko) ====

@@ -293,7 +293,11 @@
 
 #define VM_PAGE_TO_PHYS(entry)	((entry)->phys_addr)
 
-#define PHYS_TO_VM_PAGE(pa)	vm_page_from_phys(pa)
+#ifdef SPARSE_PHYSICAL_MEMORY
+#define	PHYS_TO_VM_PAGE(pa)	vm_page_from_phys(pa)
+#else
+#define	PHYS_TO_VM_PAGE(pa)	(&vm_page_array[atop(pa) - first_page ])
+#endif
 
 extern struct mtx vm_page_queue_mtx;
 #define vm_page_lock_queues()   mtx_lock(&vm_page_queue_mtx)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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