Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2002 05:39:41 +0100
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        arch@freebsd.org
Subject:   "MB" instead of "K bytes" in memory probe?
Message-ID:  <xzpiszk4k1e.fsf@flood.ping.uio.no>

next in thread | raw e-mail | index | archive | help
--=-=-=

The attached patch replaces the "K bytes" figure in the memory probe
("{real,avail} memory = XXX") with a MB figure.  Before-and-after from
/var/log/messages:

Oct 21 22:44:21 dsa kernel: real memory  = 266493952 (260248K bytes)
Oct 21 22:44:21 dsa kernel: avail memory = 253214720 (247280K bytes)
Oct 29 15:55:18 dsa kernel: real memory  = 266493952 (254 MB)
Oct 29 15:55:18 dsa kernel: avail memory = 251641856 (239 MB)

Not a big thing, but I find the last two lines far easier to read than
the first two.  Any objections to committing this patch?

DES
-- 
Dag-Erling Smorgrav - des@ofug.org


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=memory.diff

Index: sys/alpha/alpha/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/machdep.c,v
retrieving revision 1.187
diff -u -r1.187 machdep.c
--- sys/alpha/alpha/machdep.c	25 Oct 2002 19:10:55 -0000	1.187
+++ sys/alpha/alpha/machdep.c	29 Oct 2002 14:10:34 -0000
@@ -266,7 +266,8 @@
 #ifdef PERFMON
 	perfmon_init();
 #endif
-	printf("real memory  = %ld (%ldK bytes)\n", alpha_ptob(Maxmem), alpha_ptob(Maxmem) / 1024);
+	printf("real memory  = %ld (%ld MB)\n", alpha_ptob(Maxmem),
+	    alpha_ptob(Maxmem) / 1048576);
 
 	/*
 	 * Display any holes after the first chunk of extended memory.
@@ -285,8 +286,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ldK bytes)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1024);
+	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
+	    ptoa(cnt.v_free_count) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
Index: sys/i386/i386/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v
retrieving revision 1.545
diff -u -r1.545 machdep.c
--- sys/i386/i386/machdep.c	25 Oct 2002 19:10:56 -0000	1.545
+++ sys/i386/i386/machdep.c	29 Oct 2002 14:11:05 -0000
@@ -236,8 +236,8 @@
 #ifdef PERFMON
 	perfmon_init();
 #endif
-	printf("real memory  = %u (%uK bytes)\n", ptoa(Maxmem),
-	    ptoa(Maxmem) / 1024);
+	printf("real memory  = %u (%u MB)\n", ptoa(Maxmem),
+	    ptoa(Maxmem) / 1048576);
 	/*
 	 * Display any holes after the first chunk of extended memory.
 	 */
@@ -257,8 +257,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %u (%uK bytes)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1024);
+	printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count),
+	    ptoa(cnt.v_free_count) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
Index: sys/ia64/ia64/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/ia64/ia64/machdep.c,v
retrieving revision 1.117
diff -u -r1.117 machdep.c
--- sys/ia64/ia64/machdep.c	25 Oct 2002 19:10:56 -0000	1.117
+++ sys/ia64/ia64/machdep.c	29 Oct 2002 14:12:10 -0000
@@ -196,7 +196,8 @@
 #ifdef PERFMON
 	perfmon_init();
 #endif
-	printf("real memory  = %ld (%ldK bytes)\n", ia64_ptob(Maxmem), ia64_ptob(Maxmem) / 1024);
+	printf("real memory  = %ld (%ld MB)\n", ia64_ptob(Maxmem),
+	    ia64_ptob(Maxmem) / 1048576);
 
 	/*
 	 * Display any holes after the first chunk of extended memory.
@@ -215,8 +216,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ldK bytes)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1024);
+	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
+	    ptoa(cnt.v_free_count) / 1048576);
  
 	if (fpswa_interface == NULL)
 		printf("Warning: no FPSWA package supplied\n");
Index: sys/pc98/i386/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/pc98/i386/machdep.c,v
retrieving revision 1.300
diff -u -r1.300 machdep.c
--- sys/pc98/i386/machdep.c	26 Oct 2002 15:44:06 -0000	1.300
+++ sys/pc98/i386/machdep.c	29 Oct 2002 14:14:41 -0000
@@ -256,8 +256,8 @@
 #ifdef PERFMON
 	perfmon_init();
 #endif
-	printf("real memory  = %u (%uK bytes)\n", ptoa(Maxmem),
-	    ptoa(Maxmem) / 1024);
+	printf("real memory  = %u (%u MB)\n", ptoa(Maxmem),
+	    ptoa(Maxmem) / 1048576);
 	/*
 	 * Display any holes after the first chunk of extended memory.
 	 */
@@ -277,8 +277,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %u (%uK bytes)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1024);
+	printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count),
+	    ptoa(cnt.v_free_count) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
Index: sys/powerpc/powerpc/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/powerpc/powerpc/machdep.c,v
retrieving revision 1.40
diff -u -r1.40 machdep.c
--- sys/powerpc/powerpc/machdep.c	25 Oct 2002 19:10:57 -0000	1.40
+++ sys/powerpc/powerpc/machdep.c	29 Oct 2002 14:15:05 -0000
@@ -199,8 +199,8 @@
 #ifdef PERFMON
 	perfmon_init();
 #endif
-	printf("real memory  = %ld (%ldK bytes)\n", ptoa(Maxmem),
-	    ptoa(Maxmem) / 1024);
+	printf("real memory  = %ld (%ld MB)\n", ptoa(Maxmem),
+	    ptoa(Maxmem) / 1048576);
 
 	/*
 	 * Display any holes after the first chunk of extended memory.
@@ -220,8 +220,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ldK bytes)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1024);
+	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
+	    ptoa(cnt.v_free_count) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.

--=-=-=--

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




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