linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
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: Tue, 26 Sep 2023 09:39:04 +0800	[thread overview]
Message-ID: <39e981f0-3b73-d48b-1f58-cfedab6139fe@huawei.com> (raw)
In-Reply-To: <20230925081400.9593189a7665c6ff1f812855@linux-foundation.org>



On 2023/9/25 23:14, Andrew Morton wrote:
> 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?  

Right!Thank you. Commit dae0087aeff4 just replaces
damon_va_apply_three_regions() with damon_set_regions(),not first
introduce damon_set_regions(). Sorry, there is a mistake.

> 
> I'll go with 9f86d624292c for now.


  reply	other threads:[~2023-09-26  1:39 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
2023-09-26  1:39   ` Ruan Jinjie [this message]
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=39e981f0-3b73-d48b-1f58-cfedab6139fe@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --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