* [PATCH] mm/memblock: add debug output for the memblock_add
@ 2015-03-28 17:08 Alexander Kuleshov
2015-03-31 23:38 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kuleshov @ 2015-03-28 17:08 UTC (permalink / raw)
To: Andrew Morton, Martin Schwidefsky, Philipp Hachtmann,
Fabian Frederick, Catalin Marinas, Emil Medve, Akinobu Mita,
Tang Chen, Tony Luck
Cc: linux-mm, linux-kernel, Alexander Kuleshov
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.
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
mm/memblock.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 252b77b..c7b8306 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -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);
}
/**
--
2.3.3.611.g09038fc.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/memblock: add debug output for the memblock_add
2015-03-28 17:08 [PATCH] mm/memblock: add debug output for the memblock_add Alexander Kuleshov
@ 2015-03-31 23:38 ` Andrew Morton
2015-04-01 7:21 ` Alexander Kuleshov
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2015-03-31 23:38 UTC (permalink / raw)
To: Alexander Kuleshov
Cc: Martin Schwidefsky, Philipp Hachtmann, Fabian Frederick,
Catalin Marinas, Emil Medve, Akinobu Mita, Tang Chen, Tony Luck,
linux-mm, linux-kernel
On Sat, 28 Mar 2015 23:08:03 +0600 Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
> 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.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
> mm/memblock.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 252b77b..c7b8306 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -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",
I guess this should be "memblock_add:". That's what
memblock_reserve_region() does?
--- a/mm/memblock.c~mm-memblock-add-debug-output-for-the-memblock_add-fix
+++ a/mm/memblock.c
@@ -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_);
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/memblock: add debug output for the memblock_add
2015-03-31 23:38 ` Andrew Morton
@ 2015-04-01 7:21 ` Alexander Kuleshov
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2015-04-01 7:21 UTC (permalink / raw)
To: Andrew Morton
Cc: Martin Schwidefsky, Philipp Hachtmann, Fabian Frederick,
Catalin Marinas, Emil Medve, Akinobu Mita, Tang Chen, Tony Luck,
linux-mm, LKML
2015-04-01 5:38 GMT+06:00 Andrew Morton <akpm@linux-foundation.org>:
> On Sat, 28 Mar 2015 23:08:03 +0600 Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
>
> I guess this should be "memblock_add:". That's what
> memblock_reserve_region() does?
>
> --- a/mm/memblock.c~mm-memblock-add-debug-output-for-the-memblock_add-fix
> +++ a/mm/memblock.c
> @@ -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_);
> _
>
Yes, it is much cleaner. Thank you Andrew.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-01 7:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-28 17:08 [PATCH] mm/memblock: add debug output for the memblock_add Alexander Kuleshov
2015-03-31 23:38 ` Andrew Morton
2015-04-01 7:21 ` Alexander Kuleshov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).