lkml.org 
[lkml]   [2010]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 18/37] x86, lmb: Use lmb_debug to control debug message print out
    Date
    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 <yinghai@kernel.org>
    ---
    arch/x86/mm/lmb.c | 24 ++++++++++++++++++------
    1 files changed, 18 insertions(+), 6 deletions(-)

    diff --git a/arch/x86/mm/lmb.c b/arch/x86/mm/lmb.c
    index 15fd3e4..5007dbf 100644
    --- a/arch/x86/mm/lmb.c
    +++ b/arch/x86/mm/lmb.c
    @@ -121,11 +121,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_region *r = &lmb.reserved.regions[i];
    - pr_info(" #%d [%010llx - %010llx]\n", i, (u64)r->base, (u64)r->base + r->size);
    + if (lmb_debug)
    + pr_info(" #%d [%010llx - %010llx]\n", i, (u64)r->base, (u64)r->base + r->size);
    final_start = PFN_DOWN(r->base);
    final_end = PFN_UP(r->base + r->size);
    if (final_start >= final_end)
    @@ -205,17 +207,21 @@ void __init lmb_to_bootmem(u64 start, u64 end)
    lmb_free(__pa(lmb.reserved.regions), sizeof(struct lmb_region) * lmb.reserved.max);

    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_region *r = &lmb.reserved.regions[i];
    - pr_info(" #%d [%010llx - %010llx] ", i, (u64)r->base, (u64)r->base + r->size);
    + if (lmb_debug)
    + pr_info(" #%d [%010llx - %010llx] ", i, (u64)r->base, (u64)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 ? */
    @@ -306,6 +312,9 @@ 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(start, end - start);
    }

    @@ -317,6 +326,9 @@ 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);
    +
    lmb_free(start, end - start);
    }

    --
    1.6.4.2


    \
     
     \ /
      Last update: 2010-05-14 21:59    [W:0.025 / U:119.984 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site