mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Len Brown <len.brown@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jack Steiner <steiner@sgi.com>, Robin Holt <holt@sgi.com>,
	Lori Gilbertson <loriann@sgi.com>,
	x86@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] x86: Minimize initial Bootmem messages
Date: Fri, 21 Jan 2011 14:25:05 -0600	[thread overview]
Message-ID: <20110121202503.329746830@gulag1.americas.sgi.com> (raw)
In-Reply-To: <20110121202502.090169599@gulag1.americas.sgi.com>

[-- Attachment #1: minimize-bootmem-msgs --]
[-- Type: text/plain, Size: 3488 bytes --]

The majority of Bootmem setup information is repeated for
every node.  Minimize the output by showing early reservations
only once unless it changes for a specific node, and condense
the first three lines into one line.

v1: Added pertinent __init & __initdata specifiers.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Jack Steiner <steiner@sgi.com>
Reviewed-by: Robin Holt <holt@sgi.com>
---
 arch/x86/kernel/e820.c |   31 ++++++++++++++++++++++---------
 arch/x86/mm/numa_64.c  |   12 +++---------
 2 files changed, 25 insertions(+), 18 deletions(-)

--- linux-2.6.32.orig/arch/x86/kernel/e820.c
+++ linux-2.6.32/arch/x86/kernel/e820.c
@@ -922,29 +922,42 @@ void __init free_early(u64 start, u64 en
 
 void __init early_res_to_bootmem(u64 start, u64 end)
 {
-	int i, count;
+	int i, count, same = 1;
 	u64 final_start, final_end;
+	static struct early_res prev[MAX_EARLY_RES] __initdata;
 
 	count  = 0;
-	for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++)
+	for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
+		/* remove redundant messages */
+		if (prev[i].start != early_res[i].start ||
+		    prev[i].end != early_res[i].end) {
+			prev[i].start = early_res[i].start;
+			prev[i].end = early_res[i].end;
+			same =  0;
+		}
 		count++;
+	}
+	if (same) {
+		pr_cont("ER:%d %llx+%llx\n", count, start, end-start);
+		return;
+	}
+
+	pr_info("Early Reservations: %d [%llx+%llx]\n",
+		count, start, end-start);
 
-	printk(KERN_INFO "(%d early reservations) ==> bootmem [%010llx - %010llx]\n",
-			 count, start, end);
 	for (i = 0; i < count; i++) {
 		struct early_res *r = &early_res[i];
-		printk(KERN_INFO "  #%d [%010llx - %010llx] %16s", i,
+		pr_info("  #%d [%010llx - %010llx] %16s", i,
 			r->start, r->end, r->name);
 		final_start = max(start, r->start);
 		final_end = min(end, r->end);
 		if (final_start >= final_end) {
-			printk(KERN_CONT "\n");
+			pr_cont("\n");
 			continue;
 		}
-		printk(KERN_CONT " ==> [%010llx - %010llx]\n",
-			final_start, final_end);
+		pr_cont(" ==> [%010llx - %010llx]\n", final_start, final_end);
 		reserve_bootmem_generic(final_start, final_end - final_start,
-				BOOTMEM_DEFAULT);
+			BOOTMEM_DEFAULT);
 	}
 }
 
--- linux-2.6.32.orig/arch/x86/mm/numa_64.c
+++ linux-2.6.32/arch/x86/mm/numa_64.c
@@ -201,9 +201,6 @@ setup_node_bootmem(int nodeid, unsigned
 
 	start = roundup(start, ZONE_ALIGN);
 
-	printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid,
-	       start, end);
-
 	start_pfn = start >> PAGE_SHIFT;
 	last_pfn = end >> PAGE_SHIFT;
 
@@ -219,8 +216,6 @@ setup_node_bootmem(int nodeid, unsigned
 	if (node_data[nodeid] == (void *)cache_alias_offset)
 		return;
 	nodedata_phys = __pa(node_data[nodeid]);
-	printk(KERN_INFO "  NODE_DATA [%016lx - %016lx]\n", nodedata_phys,
-		nodedata_phys + pgdat_size - 1);
 
 	memset(NODE_DATA(nodeid), 0, sizeof(pg_data_t));
 	NODE_DATA(nodeid)->bdata = &bootmem_node_data[nodeid];
@@ -258,12 +253,11 @@ setup_node_bootmem(int nodeid, unsigned
 					 bootmap_start >> PAGE_SHIFT,
 					 start_pfn, last_pfn);
 
-	printk(KERN_INFO "  bootmap [%016lx -  %016lx] pages %lx\n",
-		 bootmap_start, bootmap_start + bootmap_size - 1,
-		 bootmap_pages);
-
 	free_bootmem_with_active_regions(nodeid, end);
 
+	pr_info("Bootmem Node %d: data %lx map %lx+%lx pgs %lx ",
+		nodeid, start, bootmap_start, bootmap_size, bootmap_pages);
+
 	/*
 	 * convert early reserve to bootmem reserve earlier
 	 * otherwise early_node_mem could use early reserved mem

-- 

  parent reply	other threads:[~2011-01-21 20:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 20:25 [PATCH 0/6] init: Shrink early messages to prevent overflowing the kernel log buffer Mike Travis
2011-01-21 20:25 ` [PATCH 1/6] printk: Allocate kernel log buffer earlier v1 Mike Travis
2011-01-21 20:25 ` [PATCH 2/6] ACPI: Minimize X2APIC initial messages Mike Travis
2011-01-21 20:25 ` Mike Travis [this message]
2011-01-21 20:25 ` [PATCH 4/6] x86: Minimize initial e820 messages Mike Travis
2011-01-21 20:25 ` [PATCH 5/6] x86: Minimize SRAT messages Mike Travis
2011-01-21 20:25 ` [PATCH 6/6] printk: Minimize time zero output Mike Travis
  -- strict thread matches above, loose matches on Subject: below --
2011-01-19 23:01 [PATCH 0/6] init: Shrink early messages to prevent overflowing the kernel log buffer Mike Travis
2011-01-19 23:01 ` [PATCH 3/6] x86: Minimize initial Bootmem messages Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110121202503.329746830@gulag1.americas.sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=holt@sgi.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loriann@sgi.com \
    --cc=mingo@elte.hu \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®