linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Isaac Manjarres <isaacmanjarres@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Saravana Kannan <saravanak@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	kernel-team@android.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 0/2] Fixes for kmemleak tracking with CMA regions
Date: Tue, 24 Jan 2023 13:19:57 -0800	[thread overview]
Message-ID: <Y9BLfUz5GY69zmjn@google.com> (raw)
In-Reply-To: <Y8/96eIu47UfqsWO@arm.com>

On Tue, Jan 24, 2023 at 03:48:57PM +0000, Catalin Marinas wrote:
> Thanks for digging this out. This patch shouldn't have ended up upstream
> (commit 972fa3a7c17c "mm: kmemleak: alloc gray object for reserved
> region with direct map"). I thought both Calvin Zhang and I agreed that
> it's not the correct approach (not even sure there was a real problem to
> fix).
> 
> Do you still get the any faults with the above commit reverted? I'd
> prefer this if it works rather than adding unnecessary
> kmemleak_alloc/free callbacks that pretty much cancel each-other.
Yes, I still see the same problem after reverting that commit. The problem
still persists because there are CMA areas that are allocated through
memblock_phys_alloc_range(), which invokes kmemleak_alloc_phys(). The
allocation call stack is along the lines of:

kmemleak_alloc_phys()
memblock_alloc_range_nid()
memblock_phys_alloc_range()
__reserved_mem_alloc_size()
fdt_init_reserved_mem()

I also followed up on my suggestion about adding a flags parameter to
the memblock allocation functions to be able to use
MEMBLOCK_ALLOC_NOLEAKTRACE in this particular scenario, but that would
involve changing many call-sites, which doesn't make much sense given
that there are only 4 call-sites that actually use this flag.

Maybe adding a new memblock allocation function that allows this flag to
be passed as just a flag can be used to avoid creating these kmemleak
objects for CMA allocations?

--Isaac


  parent reply	other threads:[~2023-01-24 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 22:16 Isaac J. Manjarres
2023-01-09 22:16 ` [PATCH v1 1/2] mm/cma.c: Make kmemleak aware of all " Isaac J. Manjarres
2023-01-09 22:16 ` [PATCH v1 2/2] mm/cma.c: Delete kmemleak objects when freeing CMA areas to buddy at boot Isaac J. Manjarres
2023-01-18 17:16 ` [PATCH v1 0/2] Fixes for kmemleak tracking with CMA regions Catalin Marinas
2023-01-20  0:20   ` Isaac Manjarres
2023-01-24 15:48     ` Catalin Marinas
2023-01-24 20:20       ` Andrew Morton
2023-01-24 21:23         ` Isaac Manjarres
2023-01-24 21:19       ` Isaac Manjarres [this message]
2023-01-25 12:08         ` Catalin Marinas
2023-01-27  2:39           ` Isaac Manjarres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9BLfUz5GY69zmjn@google.com \
    --to=isaacmanjarres@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=saravanak@google.com \
    --cc=surenb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox