Commit a62e2f4f508863da8e0c2f2b42f5252a87330297

Authored by Bjorn Helgaas
Committed by Linus Torvalds
1 parent 3af684c7c5

mm: print physical addresses consistently with other parts of kernel

Print physical address info in a style consistent with the %pR style used
elsewhere in the kernel.  For example:

    -Zone PFN ranges:
    +Zone ranges:
    -  DMA32    0x00000010 -> 0x00100000
    +  DMA32    [mem 0x00010000-0xffffffff]
    -  Normal   0x00100000 -> 0x01080000
    +  Normal   [mem 0x100000000-0x107fffffff]

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 19 additions and 14 deletions Side-by-side Diff

... ... @@ -74,8 +74,7 @@
74 74 res->end = start + size - 1;
75 75 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
76 76 if (request_resource(&iomem_resource, res) < 0) {
77   - printk("System RAM resource %llx - %llx cannot be added\n",
78   - (unsigned long long)res->start, (unsigned long long)res->end);
  77 + printk("System RAM resource %pR cannot be added\n", res);
79 78 kfree(res);
80 79 res = NULL;
81 80 }
... ... @@ -502,8 +501,10 @@
502 501 online_pages_range);
503 502 if (ret) {
504 503 mutex_unlock(&zonelists_mutex);
505   - printk(KERN_DEBUG "online_pages %lx at %lx failed\n",
506   - nr_pages, pfn);
  504 + printk(KERN_DEBUG "online_pages [mem %#010llx-%#010llx] failed\n",
  505 + (unsigned long long) pfn << PAGE_SHIFT,
  506 + (((unsigned long long) pfn + nr_pages)
  507 + << PAGE_SHIFT) - 1);
507 508 memory_notify(MEM_CANCEL_ONLINE, &arg);
508 509 unlock_memory_hotplug();
509 510 return ret;
... ... @@ -977,8 +978,9 @@
977 978 return 0;
978 979  
979 980 failed_removal:
980   - printk(KERN_INFO "memory offlining %lx to %lx failed\n",
981   - start_pfn, end_pfn);
  981 + printk(KERN_INFO "memory offlining [mem %#010llx-%#010llx] failed\n",
  982 + (unsigned long long) start_pfn << PAGE_SHIFT,
  983 + ((unsigned long long) end_pfn << PAGE_SHIFT) - 1);
982 984 memory_notify(MEM_CANCEL_OFFLINE, &arg);
983 985 /* pushback to free area */
984 986 undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
... ... @@ -4815,7 +4815,7 @@
4815 4815 find_zone_movable_pfns_for_nodes();
4816 4816  
4817 4817 /* Print out the zone ranges */
4818   - printk("Zone PFN ranges:\n");
  4818 + printk("Zone ranges:\n");
4819 4819 for (i = 0; i < MAX_NR_ZONES; i++) {
4820 4820 if (i == ZONE_MOVABLE)
4821 4821 continue;
4822 4822  
4823 4823  
4824 4824  
4825 4825  
... ... @@ -4824,22 +4824,25 @@
4824 4824 arch_zone_highest_possible_pfn[i])
4825 4825 printk(KERN_CONT "empty\n");
4826 4826 else
4827   - printk(KERN_CONT "%0#10lx -> %0#10lx\n",
4828   - arch_zone_lowest_possible_pfn[i],
4829   - arch_zone_highest_possible_pfn[i]);
  4827 + printk(KERN_CONT "[mem %0#10lx-%0#10lx]\n",
  4828 + arch_zone_lowest_possible_pfn[i] << PAGE_SHIFT,
  4829 + (arch_zone_highest_possible_pfn[i]
  4830 + << PAGE_SHIFT) - 1);
4830 4831 }
4831 4832  
4832 4833 /* Print out the PFNs ZONE_MOVABLE begins at in each node */
4833   - printk("Movable zone start PFN for each node\n");
  4834 + printk("Movable zone start for each node\n");
4834 4835 for (i = 0; i < MAX_NUMNODES; i++) {
4835 4836 if (zone_movable_pfn[i])
4836   - printk(" Node %d: %lu\n", i, zone_movable_pfn[i]);
  4837 + printk(" Node %d: %#010lx\n", i,
  4838 + zone_movable_pfn[i] << PAGE_SHIFT);
4837 4839 }
4838 4840  
4839 4841 /* Print out the early_node_map[] */
4840   - printk("Early memory PFN ranges\n");
  4842 + printk("Early memory node ranges\n");
4841 4843 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid)
4842   - printk(" %3d: %0#10lx -> %0#10lx\n", nid, start_pfn, end_pfn);
  4844 + printk(" node %3d: [mem %#010lx-%#010lx]\n", nid,
  4845 + start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
4843 4846  
4844 4847 /* Initialise every node */
4845 4848 mminit_verify_pageflags_layout();