2021-12-20 16:39:53

by andrey.konovalov

[permalink] [raw]
Subject: [PATCH] lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test

From: Andrey Konovalov <[email protected]>

Make do_kmem_cache_size_bulk() destroy the cache it creates.

Fixes: 03a9349ac0e0 ("lib/test_meminit: add a kmem_cache_alloc_bulk() test")
Signed-off-by: Andrey Konovalov <[email protected]>
---
lib/test_meminit.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/test_meminit.c b/lib/test_meminit.c
index e4f706a404b3..3ca717f11397 100644
--- a/lib/test_meminit.c
+++ b/lib/test_meminit.c
@@ -337,6 +337,7 @@ static int __init do_kmem_cache_size_bulk(int size, int *total_failures)
if (num)
kmem_cache_free_bulk(c, num, objects);
}
+ kmem_cache_destroy(c);
*total_failures += fail;
return 1;
}
--
2.25.1



2021-12-20 17:08:54

by Marco Elver

[permalink] [raw]
Subject: Re: [PATCH] lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test

On Mon, 20 Dec 2021 at 17:39, <[email protected]> wrote:
>
> From: Andrey Konovalov <[email protected]>
>
> Make do_kmem_cache_size_bulk() destroy the cache it creates.
>
> Fixes: 03a9349ac0e0 ("lib/test_meminit: add a kmem_cache_alloc_bulk() test")
> Signed-off-by: Andrey Konovalov <[email protected]>

Reviewed-by: Marco Elver <[email protected]>


> ---
> lib/test_meminit.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/test_meminit.c b/lib/test_meminit.c
> index e4f706a404b3..3ca717f11397 100644
> --- a/lib/test_meminit.c
> +++ b/lib/test_meminit.c
> @@ -337,6 +337,7 @@ static int __init do_kmem_cache_size_bulk(int size, int *total_failures)
> if (num)
> kmem_cache_free_bulk(c, num, objects);
> }
> + kmem_cache_destroy(c);
> *total_failures += fail;
> return 1;
> }
> --
> 2.25.1
>