Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757066Ab0DIGOc (ORCPT ); Fri, 9 Apr 2010 02:14:32 -0400 Received: from acsinet12.oracle.com ([141.146.126.234]:37528 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755160Ab0DIGHL (ORCPT ); Fri, 9 Apr 2010 02:07:11 -0400 From: Yinghai Lu To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton Cc: David Miller , Benjamin Herrenschmidt , Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu Subject: [PATCH 19/39] lmb: Use lmb_debug to control debug message print out Date: Thu, 8 Apr 2010 23:03:48 -0700 Message-Id: <1270793048-23796-20-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.6.4.2 In-Reply-To: <1270793048-23796-1-git-send-email-yinghai@kernel.org> References: <1270793048-23796-1-git-send-email-yinghai@kernel.org> X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4BBEC3EB.011C,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4108 Lines: 103 Also let lmb_reserve_area/lmb_free_area could print out name if lmb=debug is specified will also print ther name when reserve_lmb_area/free_lmb_area are called. Signed-off-by: Yinghai Lu --- mm/lmb.c | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mm/lmb.c b/mm/lmb.c index 34fc030..dfbf660 100644 --- a/mm/lmb.c +++ b/mm/lmb.c @@ -591,8 +591,9 @@ static void __init __check_and_double_region_array(struct lmb_region *type, memset(&old[0], 0, sizeof(struct lmb_property) * rgnsz); type->region = new; type->nr_regions = rgnsz * 2; - printk(KERN_DEBUG "lmb.reserved.region array is doubled to %ld at [%llx - %llx]\n", - type->nr_regions, mem, mem + size - 1); + if (lmb_debug) + pr_info("lmb.reserved.region array is doubled to %ld at [%010llx - %010llx]\n", + type->nr_regions, mem, mem + size - 1); /* Free old one ?*/ if (old != static_region) @@ -619,6 +620,8 @@ void __init lmb_reserve_area(u64 start, u64 end, char *name) if (WARN_ONCE(start > end, "lmb_reserve_area: wrong range [%#llx, %#llx]\n", start, end)) return; + if (lmb_debug) + pr_info(" lmb_reserve_area: [%010llx, %010llx] %16s\n", start, end, name); __lmb_reserve_area(start, end, name); } @@ -635,6 +638,8 @@ void __init lmb_reserve_area_overlap_ok(u64 start, u64 end, char *name) if (WARN_ONCE(start > end, "lmb_reserve_area_overlap_ok: wrong range [%#llx, %#llx]\n", start, end)) return; + if (lmb_debug) + pr_info(" lmb_reserve_area_overlap_ok: [%010llx, %010llx] %16s\n", start, end, name); /* Free that region at first */ lmb_free(start, end - start); __lmb_reserve_area(start, end, name); @@ -648,6 +653,8 @@ void __init lmb_free_area(u64 start, u64 end) if (WARN_ONCE(start > end, "lmb_free_area: wrong range [%#llx, %#llx]\n", start, end)) return; + if (lmb_debug) + pr_info(" lmb_free_area: [%010llx, %010llx]\n", start, end); /* keep punching hole, could run out of slots too */ lmb_free(start, end - start); __check_and_double_region_array(&lmb.reserved, &lmb_reserved_region[0]); @@ -688,11 +695,13 @@ static void __init subtract_lmb_reserved(struct range *range, int az) count = lmb.reserved.cnt; - pr_info("Subtract (%d early reservations)\n", count); + if (lmb_debug) + pr_info("Subtract (%d early reservations)\n", count); for (i = 0; i < count; i++) { struct lmb_property *r = &lmb.reserved.region[i]; - pr_info(" #%d [%010llx - %010llx]\n", i, r->base, r->base + r->size); + if (lmb_debug) + pr_info(" #%03d [%010llx - %010llx]\n", i, r->base, r->base + r->size); final_start = PFN_DOWN(r->base); final_end = PFN_UP(r->base + r->size); if (final_start >= final_end) @@ -748,17 +757,21 @@ void __init lmb_to_bootmem(u64 start, u64 end) lmb_free(__pa(lmb.reserved.region), sizeof(struct lmb_property) * lmb.reserved.nr_regions); count = lmb.reserved.cnt; - pr_info("(%d early reservations) ==> bootmem [%010llx - %010llx]\n", count, start, end); + if (lmb_debug) + pr_info("(%d early reservations) ==> bootmem [%010llx - %010llx]\n", count, start, end); for (i = 0; i < count; i++) { struct lmb_property *r = &lmb.reserved.region[i]; - pr_info(" #%d [%010llx - %010llx] ", i, r->base, r->base + r->size); + if (lmb_debug) + pr_info(" #%03d [%010llx - %010llx] ", i, r->base, r->base + r->size); final_start = max(start, r->base); final_end = min(end, r->base + r->size); if (final_start >= final_end) { - pr_cont("\n"); + if (lmb_debug) + pr_cont("\n"); continue; } - pr_cont(" ==> [%010llx - %010llx]\n", final_start, final_end); + if (lmb_debug) + pr_cont(" ==> [%010llx - %010llx]\n", final_start, final_end); reserve_bootmem_generic(final_start, final_end - final_start, BOOTMEM_DEFAULT); } /* Clear them to avoid misusing ? */ -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/