From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AE128217F24 for ; Wed, 7 Jan 2026 10:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767780419; cv=none; b=V4sIvMD3vrIq+VPwvJe15RqSVn4tQLXfIz18+1OW2GCijqpSLpGMwTfb1ob1+v+JRhndIktVWU9zdyfWaBR6g3tYN9gQOn+L9XEEnf1r8vg4UvS3fwF3cVqlKBQLpw1PMnJmli4DE2M9GJRCPPwTo/A2RcGRwErd3eOr5B/y2Bc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767780419; c=relaxed/simple; bh=nEghX8BiAqAAWqHNMWEJ22do60eHFb1GQ4oeVhHrdpo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VkqpzB2PkA0KL+QsTL4BKfzN2jqntOmhTHpn635pOC/6NpyMKBq6ZhQyhnHHnexqKkKq0KpDMFj3gxxWRpO2SzvzU62PWEXnSrxFf/GRo+WLjXsprii+ezMxaJN5dKfcma9T6mYVUL+UpS3HNBaAbXy+1zHybONtY2i4hc4cvHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iodDBfPB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iodDBfPB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70CEEC4CEF7; Wed, 7 Jan 2026 10:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767780418; bh=nEghX8BiAqAAWqHNMWEJ22do60eHFb1GQ4oeVhHrdpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iodDBfPBhdLwX8pOjdmGnJnUxVl7xS08q5+D8BsMOb6lm3GcJCWmkuDCE65gWHFqd 32pHmYlEab+je+ZkjWMrwlN2GEIzZwffcH0HZh0b64+ieCEGFnRIm/NclkKM+Oipf3 3aLbPB6lk7ZxAG1MbpSTwvtNyWwbtQz79LOLGwZJPyT3tJX/3Beu26Uwh6w0WOmFi7 Y2NHFcsIc/cS0XKLxn2VHzWwL7CjFJZa1OW4329qfOvkC2z2X6soTjKMdZmsodfugG ZdL5NiaV5Z0lycBNtBNIr/HTqLeuOiq38c9NH7bvoL1yUe3lKYwRPOt/dU6G2UNfQr yAUr2Vn731tLg== Date: Wed, 7 Jan 2026 12:06:51 +0200 From: Mike Rapoport To: l00580197 Cc: Alexander Graf , Pasha Tatashin , Pratyush Yadav , 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 Message-ID: References: <20260107022427.4114424-1-longwei27@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260107022427.4114424-1-longwei27@huawei.com> On Wed, Jan 07, 2026 at 10:24:27AM +0800, l00580197 wrote: > 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) > --- > 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.