[lkml]   [2007]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[ review 09/28] sparsemem: fix oops in x86_64 show_mem
    We aren't sampling for holes in memory. Thus we encounter a section hole with
    empty section map pointer for SPARSEMEM and OOPs for show_mem. This issue
    has been seen in 2.6.21, current git and current mm. This patch is for
    2.6.21 stable. It was tested against sparsemem.

    Previous to commit f0a5a58aa812b31fd9f197c4ba48245942364eae memory_present
    was called for node_start_pfn to node_end_pfn. This would cover the hole(s)
    with reserved pages and valid sections. Most SPARSEMEM supported arches
    do a pfn_valid check in show_mem before computing the page structure address.

    This issue was brought to my attention on IRC by Arnaldo Carvalho de Melo at Thanks to Arnaldo for testing.

    Signed-off-by: Bob Picco <>
    Signed-off-by: Chris Wright <>
    Signed-off-by: Greg Kroah-Hartman <>
    arch/x86_64/mm/init.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
    index 2489aa7..e67cc4f 100644
    --- a/arch/x86_64/mm/init.c
    +++ b/arch/x86_64/mm/init.c
    @@ -72,6 +72,8 @@ void show_mem(void)

    for_each_online_pgdat(pgdat) {
    for (i = 0; i < pgdat->node_spanned_pages; ++i) {
    + if (!pfn_valid(pgdat->node_start_pfn + i))
    + continue;
    page = pfn_to_page(pgdat->node_start_pfn + i);
    if (PageReserved(page))
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-08-11 21:03    [W:0.019 / U:164.840 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site