svn commit: r279921 - in stable: 10/sys/amd64/amd64 9/sys/amd64/amd64

John Baldwin jhb at FreeBSD.org
Thu Mar 12 15:08:25 UTC 2015


Author: jhb
Date: Thu Mar 12 15:08:23 2015
New Revision: 279921
URL: https://svnweb.freebsd.org/changeset/base/279921

Log:
  MFC 277713:
  If the boot-time memory test is enabled, output a dot ('.') for
  each GB of RAM tested so people watching the console can see that
  the machine is making progress and not hung.
  
  PR:		196650

Modified:
  stable/9/sys/amd64/amd64/machdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/amd64/amd64/machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/9/sys/amd64/amd64/machdep.c	Thu Mar 12 14:55:33 2015	(r279920)
+++ stable/9/sys/amd64/amd64/machdep.c	Thu Mar 12 15:08:23 2015	(r279921)
@@ -1367,6 +1367,8 @@ add_smap_entry(struct bios_smap *smap, v
 	return (1);
 }
 
+#define	PAGES_PER_GB	(1024 * 1024 * 1024 / PAGE_SIZE)
+
 /*
  * Populate the (physmap) array with base/bound pairs describing the
  * available physical memory in the system, then test this memory and
@@ -1387,6 +1389,7 @@ getmemsize(caddr_t kmdp, u_int64_t first
 	struct bios_smap *smapbase, *smap, *smapend;
 	u_int32_t smapsize;
 	quad_t dcons_addr, dcons_size;
+	int page_counter;
 
 	bzero(physmap, sizeof(physmap));
 	basemem = 0;
@@ -1501,6 +1504,9 @@ getmemsize(caddr_t kmdp, u_int64_t first
 	 * physmap is in bytes, so when converting to page boundaries,
 	 * round up the start address and round down the end address.
 	 */
+	page_counter = 0;
+	if (memtest != 0)
+		printf("Testing system memory");
 	for (i = 0; i <= physmap_idx; i += 2) {
 		vm_paddr_t end;
 
@@ -1531,6 +1537,14 @@ getmemsize(caddr_t kmdp, u_int64_t first
 				goto skip_memtest;
 
 			/*
+			 * Print a "." every GB to show we're making
+			 * progress.
+			 */
+			page_counter++;
+			if ((page_counter % PAGES_PER_GB) == 0)
+				printf(".");
+
+			/*
 			 * map page into kernel: valid, read/write,non-cacheable
 			 */
 			*pte = pa | PG_V | PG_RW | PG_N;
@@ -1617,6 +1631,8 @@ do_next:
 	}
 	*pte = 0;
 	invltlb();
+	if (memtest != 0)
+		printf("\n");
 
 	/*
 	 * XXX


More information about the svn-src-stable-9 mailing list