linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: <linux-mm@kvack.org>, <damon@lists.linux.dev>,
	SeongJae Park <sj@kernel.org>
Subject: Re: [PATCH] mm/damon/vaddr-test: Fix memory leak in damon_do_test_apply_three_regions()
Date: Mon, 25 Sep 2023 08:14:00 -0700	[thread overview]
Message-ID: <20230925081400.9593189a7665c6ff1f812855@linux-foundation.org> (raw)
In-Reply-To: <20230925072100.3725620-1-ruanjinjie@huawei.com>

On Mon, 25 Sep 2023 15:20:59 +0800 Jinjie Ruan <ruanjinjie@huawei.com> wrote:

> When CONFIG_DAMON_VADDR_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y
> and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected.
> 
> Since commit 9f86d624292c ("mm/damon/vaddr-test: remove unnecessary
> variables"), the damon_destroy_ctx() is removed, but still call
> damon_new_target() and damon_new_region(), the damon_region which is
> allocated by kmem_cache_alloc() in damon_new_region() and the damon_target
> which is allocated by kmalloc in damon_new_target() are not freed. And the
> damon_region which is allocated in damon_new_region() in
> damon_set_regions() is also not freed.
> 
> So use damon_destroy_target to free all the damon_regions and damon_target.
> 
> ...
> 
> Fixes:  9f86d624292c ("mm/damon/vaddr-test: remove unnecessary variables")
> Fixes: dae0087aeff4 ("mm/damon/vaddr: remove damon_va_apply_three_regions()")

Can we please identify a single Fixes: target?  Otherwise, how are
-stable tree maintainers to determine which kernels need the fix?  

I'll go with 9f86d624292c for now.


  reply	other threads:[~2023-09-25 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25  7:20 Jinjie Ruan
2023-09-25 15:14 ` Andrew Morton [this message]
2023-09-26  1:39   ` Ruan Jinjie
2023-09-25 16:03 ` SeongJae Park
2023-09-26  1:37   ` Ruan Jinjie

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=20230925081400.9593189a7665c6ff1f812855@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sj@kernel.org \
    /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