linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm: memblock: add more debug logs
@ 2020-11-16  4:44 Faiyaz Mohammed
  2020-11-16  7:45 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Faiyaz Mohammed @ 2020-11-16  4:44 UTC (permalink / raw)
  To: linux-mm, linux-kernel, rppt; +Cc: vinmenon, Faiyaz Mohammed

It is useful to know the exact caller of memblock_phys_alloc_range() to
track early memory reservations during development.

Currently, when memblock debugging is enabled, the allocations done with
memblock_phys_alloc_range() are only reported at memblock_reserve():

[    0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188

Add memblock_dbg() to memblock_phys_alloc_range() to get details about
its usage.

For example:

[    0.000000] memblock_phys_alloc_range: 4096 bytes align=0x1000 from=0x0000000000000000 max_addr=0x0000000000000000 early_pgtable_alloc+0x24/0x178
[    0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188

Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
---
 mm/memblock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/memblock.c b/mm/memblock.c
index 049df41..f65af9f 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1419,6 +1419,9 @@ phys_addr_t __init memblock_phys_alloc_range(phys_addr_t size,
 					     phys_addr_t start,
 					     phys_addr_t end)
 {
+	memblock_dbg("%s: %llu bytes align=0x%llx from=%pa max_addr=%pa %pS\n",
+			__func__, (u64)size, (u64)align, &start, &end,
+			(void *)_RET_IP_);
 	return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE,
 					false);
 }
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mm: memblock: add more debug logs
  2020-11-16  4:44 [PATCH v2] mm: memblock: add more debug logs Faiyaz Mohammed
@ 2020-11-16  7:45 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2020-11-16  7:45 UTC (permalink / raw)
  To: Faiyaz Mohammed; +Cc: linux-mm, linux-kernel, vinmenon

On Mon, Nov 16, 2020 at 10:14:04AM +0530, Faiyaz Mohammed wrote:
> It is useful to know the exact caller of memblock_phys_alloc_range() to
> track early memory reservations during development.
> 
> Currently, when memblock debugging is enabled, the allocations done with
> memblock_phys_alloc_range() are only reported at memblock_reserve():
> 
> [    0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188
> 
> Add memblock_dbg() to memblock_phys_alloc_range() to get details about
> its usage.
> 
> For example:
> 
> [    0.000000] memblock_phys_alloc_range: 4096 bytes align=0x1000 from=0x0000000000000000 max_addr=0x0000000000000000 early_pgtable_alloc+0x24/0x178
> [    0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188
> 
> Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>

Applied, thanks!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-16  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-16  4:44 [PATCH v2] mm: memblock: add more debug logs Faiyaz Mohammed
2020-11-16  7:45 ` Mike Rapoport

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).