mm/memblock: add debug output for the memblock_add
PATCH 1/1 mm/memblock: add debug output for the memblock_add
memblock_reserve function calls memblock_reserve_region which prints debugging information if 'memblock=debug' passed to the command line. This patch adds the same behaviour, but for the memblock_add function.
--- mm/memblock.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
mm/memblock.c +16 -2
@@ -580,10 +580,24 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,return memblock_add_range (&memblock.memory, base, size, nid,0 ); } +static int __init_memblock memblock_add_region(phys_addr_t base, +phys_addr_t size, +int nid, +unsigned long flags) +{ +struct memblock_type *_rgn = &memblock.memory; + +memblock_dbg ("memblock_memory: [%#016llx-%#016llx] flags %#02lx %pF\n" , + (unsigned long long )base, + (unsigned long long )base + size -1 , + flags, (void *)_RET_IP_); + +return memblock_add_range (_rgn, base, size, nid, flags); +} + int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size) { -return memblock_add_range (&memblock.memory, base, size, -MAX_NUMNODES ,0 ); +return memblock_add_region (base, size,MAX_NUMNODES ,0 ); }/**
Signature · 7 lines
2.3.3.611.g09038fc.dirty -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 16 lines · On Sat, 28 Mar 2015 23:08:03 +0600 Alexander Kuleshov <[email protected]>…
memblock_reservefunction callsmemblock_reserve_regionwhich prints debugging information if 'memblock=debug' passed to the command line. This patch adds the same behaviour, but for thememblock_addfunction.Signed-off-by Alexander Kuleshov <[email protected]>--- mm/memblock.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)mm/memblock.c +0
-0@@ -580,10 +580,24 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,return memblock_add_range (&memblock.memory, base, size, nid,0 );
mm/memblock.c int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, · line 590
Quoted 10 lines
mm/memblock.c +8
-0} +static int __init_memblock memblock_add_region(phys_addr_t base, +phys_addr_t size, +int nid, +unsigned long flags) +{ +struct memblock_type *_rgn = &memblock.memory; + + memblock_dbg("memblock_memory: [%#016llx-%#016llx] flags %#02lx %pF\n",
I guess this should be "memblock_add:". That's what memblock_reserve_region() does?
mm/memblock.c renamed from mm/memblock.c~mm-memblock-add-debug-output-for-the-memblock_add-fix +1 -1
@@ -587,7 +587,7 @@ static int __init_memblock memblock_add_ {struct memblock_type *_rgn = &memblock.memory; -memblock_dbg ("memblock_memory: [%#016llx-%#016llx] flags %#02lx %pF\n" , +memblock_dbg ("memblock_add: [%#016llx-%#016llx] flags %#02lx %pF\n" , (unsigned long long )base, (unsigned long long )base + size -1 , flags, (void *)_RET_IP_);
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
2015-04-01 5:38 GMT+06:00 Andrew Morton <[email protected]>:
Quoted 16 lines · On Sat, 28 Mar 2015 23:08:03 +0600 Alexander Kuleshov <[email protected]>…
I guess this should be "
memblock_add:". That's whatmemblock_reserve_region()does?mm/memblock.c renamed from mm/memblock.c~mm-memblock-add-debug-output-for-the-memblock_add-fix +1
-1@@ -587,7 +587,7 @@ static int __init_memblock memblock_add_ {struct memblock_type *_rgn = &memblock.memory; -memblock_dbg ("memblock_memory: [%#016llx-%#016llx] flags %#02lx %pF\n" , +memblock_dbg ("memblock_add: [%#016llx-%#016llx] flags %#02lx %pF\n" , (unsigned long long )base, (unsigned long long )base + size -1 , flags, (void *)_RET_IP_);
Quoted 2 lines
_
Yes, it is much cleaner. Thank you Andrew.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>