From: Mike Rapoport <rppt@kernel.org>
To: l00580197 <longwei27@huawei.com>
Cc: Alexander Graf <graf@amazon.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
kexec@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, hewenliang4@huawei.com
Subject: Re: [PATCH] kho: test: clean up residual memory upon test_kho module unload
Date: Wed, 7 Jan 2026 12:06:51 +0200 [thread overview]
Message-ID: <aV4wO1ORACvVpgAN@kernel.org> (raw)
In-Reply-To: <20260107022427.4114424-1-longwei27@huawei.com>
On Wed, Jan 07, 2026 at 10:24:27AM +0800, l00580197 wrote:
> From: Long Wei <longwei27@huawei.com>
>
> During the initialization phase, the test_kho module invokes the
> kho_preserve_folio function, which internally configures bitmaps
> within kho_mem_track and establishes chunk linked lists in KHO.
> Upon unloading the test_kho module, it is necessary to clean up
> these states.
>
> Signed-off-by: Long Wei <longwei27@huawei.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> lib/test_kho.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/test_kho.c b/lib/test_kho.c
> index 47de56280795..69230da5a056 100644
> --- a/lib/test_kho.c
> +++ b/lib/test_kho.c
> @@ -339,11 +339,15 @@ module_init(kho_test_init);
>
> static void kho_test_cleanup(void)
> {
> + /* unpreserve and free the data stored in folios */
> + kho_test_unpreserve_data(&kho_test_state);
> for (int i = 0; i < kho_test_state.nr_folios; i++)
> folio_put(kho_test_state.folios[i]);
>
> kvfree(kho_test_state.folios);
> - vfree(kho_test_state.folios_info);
> +
> + /* Unpreserve and release the FDT folio */
> + kho_unpreserve_folio(kho_test_state.fdt);
> folio_put(kho_test_state.fdt);
> }
>
> --
> 2.43.0
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-01-07 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 2:24 [PATCH] kho: test: clean up residual memory upon test_kho module unload l00580197
2026-01-07 10:06 ` Mike Rapoport [this message]
2026-01-16 17:14 ` Pratyush Yadav
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=aV4wO1ORACvVpgAN@kernel.org \
--to=rppt@kernel.org \
--cc=graf@amazon.com \
--cc=hewenliang4@huawei.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longwei27@huawei.com \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.