lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201110181605.GC4758@kernel.org>
Date:   Tue, 10 Nov 2020 20:16:05 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Faiyaz Mohammed <faiyazm@...eaurora.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        vinmenon@...eaurora.org
Subject: Re: [PATCH] mm: memblock: add more debug logs

Hi,

On Tue, Nov 10, 2020 at 05:49:58PM +0530, Faiyaz Mohammed wrote:
> Exact caller of memblock_phys_alloc_range is not available with
> "memblock=debug". Below information is not enough for memory accounting.
> for example:
> [    0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188
> 
> To enhance the memblock_dbg information or to get the exact owner of the
> memblock_reserve, add debug logs in memblock_phys_alloc_range function.

Why would you want to use memblock=debug for memory accounting or for
tracking of the owners of the reserved memory?

> After adding logs:
> [    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@...eaurora.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
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ