Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho: test: clean up residual memory upon test_kho module unload

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.

Link: https://lkml.kernel.org/r/20260107022427.4114424-1-longwei27@huawei.com
Signed-off-by: Long Wei <longwei27@huawei.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: hewenliang <hewenliang4@huawei.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Long Wei and committed by
Andrew Morton
77ce1b4c bf457942

+5 -1
+5 -1
lib/test_kho.c
··· 340 340 341 341 static void kho_test_cleanup(void) 342 342 { 343 + /* unpreserve and free the data stored in folios */ 344 + kho_test_unpreserve_data(&kho_test_state); 343 345 for (int i = 0; i < kho_test_state.nr_folios; i++) 344 346 folio_put(kho_test_state.folios[i]); 345 347 346 348 kvfree(kho_test_state.folios); 347 - vfree(kho_test_state.folios_info); 349 + 350 + /* Unpreserve and release the FDT folio */ 351 + kho_unpreserve_folio(kho_test_state.fdt); 348 352 folio_put(kho_test_state.fdt); 349 353 } 350 354