mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Isaac J. Manjarres" <isaacmanjarres@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Saravana Kannan <saravanak@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	"Isaac J. Manjarres" <isaacmanjarres@google.com>,
	kernel-team@android.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v1 1/2] mm/cma.c: Make kmemleak aware of all CMA regions
Date: Mon,  9 Jan 2023 14:16:22 -0800	[thread overview]
Message-ID: <20230109221624.592315-2-isaacmanjarres@google.com> (raw)
In-Reply-To: <20230109221624.592315-1-isaacmanjarres@google.com>

Currently, kmemleak tracks CMA regions that are specified through the
devicetree. However, if the global CMA region is specified through
the commandline, kmemleak will be unaware of the CMA region because
kmemleak_alloc_phys() is not invoked after memblock_reserve(). Add
the missing call to kmemleak_alloc_phys() so that all CMA regions are
tracked by kmemleak before they are freed to the page allocator in
cma_activate_area().

Cc: stable@vger.kernel.org
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
---
 mm/cma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/cma.c b/mm/cma.c
index 4a978e09547a..674b7fdd563e 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -318,6 +318,8 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
 			ret = -EBUSY;
 			goto err;
 		}
+
+		kmemleak_alloc_phys(base, size, 0);
 	} else {
 		phys_addr_t addr = 0;
 
-- 
2.39.0.314.g84b9a713c41-goog


  reply	other threads:[~2023-01-09 22:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 22:16 [PATCH v1 0/2] Fixes for kmemleak tracking with " Isaac J. Manjarres
2023-01-09 22:16 ` Isaac J. Manjarres [this message]
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
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=20230109221624.592315-2-isaacmanjarres@google.com \
    --to=isaacmanjarres@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=saravanak@google.com \
    --cc=stable@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®