From nobody Sun Feb 8 06:56:06 2026 Received: from canpmsgout05.his.huawei.com (canpmsgout05.his.huawei.com [113.46.200.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE140DF76 for ; Wed, 7 Jan 2026 02:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767752715; cv=none; b=WKy7KCTG/1TZA7+KykQxhF/7teOCY5hUaK4c9a6n3tilcwCi23pobRE/bVFpuRzUxgUgDsPSJWMlcFoOxWJ4FaDyL3tT/0kUbmOCMG65jZEKsHUBUEj8SYWAhyPztjUycMwVC1USyaStDaQSmFkvHBC5rBPZ+i6hgE7MHdSL2Kw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767752715; c=relaxed/simple; bh=yhcJeUuQxCucGGbJPIxAn0iknJfBfMwLZKMdT1sLEwU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=uZ54nMNT8oqJOlb+Qk+V4Qo+YRXYSkPn8i5PWxW/O2vVRbTmv+taBuDE/pMj5yqRCHPUhWVrFCfZt8cP+lseWG+3FQGcxTGKmvQGaTOlb7Nq+FL+PyFu5i1fQZJL/KUB1rF63q1q8r+De73JvOYS9OkUezQk5Ou4LGYmdIv9lec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=eSoHDgAZ; arc=none smtp.client-ip=113.46.200.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="eSoHDgAZ" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=nPVPfkr/y2YYTpshmkF6KZTylgTLjqX2OuEnIKqe7Nc=; b=eSoHDgAZDEdyakPtnm2r4lz14cJx1JhE389G5KPkFU0OloU6l16n0E1lB5q1iRsH14ch2eHPs aynE6cbhCCN/lJi1pWZWgKOszrIZVfD5i2wWU/MxUZ4tilD4RKKQ40KyA5UEOp8ggUnR894tWeU PAuSQorJ/HHw2n5/gfJhRdc= Received: from mail.maildlp.com (unknown [172.19.162.144]) by canpmsgout05.his.huawei.com (SkyGuard) with ESMTPS id 4dmBcr1kQfz12LDj; Wed, 7 Jan 2026 10:22:04 +0800 (CST) Received: from kwepemk100009.china.huawei.com (unknown [7.202.194.57]) by mail.maildlp.com (Postfix) with ESMTPS id AB7874056A; Wed, 7 Jan 2026 10:25:08 +0800 (CST) Received: from huawei.com (10.50.159.234) by kwepemk100009.china.huawei.com (7.202.194.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 7 Jan 2026 10:25:07 +0800 From: l00580197 To: Alexander Graf , Mike Rapoport , Pasha Tatashin CC: Pratyush Yadav , , , , , Long Wei Subject: [PATCH] kho: test: clean up residual memory upon test_kho module unload Date: Wed, 7 Jan 2026 10:24:27 +0800 Message-ID: <20260107022427.4114424-1-longwei27@huawei.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk100009.china.huawei.com (7.202.194.57) Content-Type: text/plain; charset="utf-8" From: Long Wei 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 Acked-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav --- 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); =20 static void kho_test_cleanup(void) { + /* unpreserve and free the data stored in folios */ + kho_test_unpreserve_data(&kho_test_state); for (int i =3D 0; i < kho_test_state.nr_folios; i++) folio_put(kho_test_state.folios[i]); =20 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); } =20 --=20 2.43.0