[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpFSE5MSDnMQ40fRx3mJ0eCLW0QDTMCbr05nrWDtC6wbaA@mail.gmail.com>
Date: Fri, 28 May 2021 10:55:36 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: Liam Howlett <liam.howlett@...cle.com>
Cc: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E . McKenney" <paulmck@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Laurent Dufour <ldufour@...ux.ibm.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rik van Riel <riel@...riel.com>,
Peter Zijlstra <peterz@...radead.org>,
Michel Lespinasse <walken.cr@...il.com>
Subject: Re: [PATCH 23/94] radix tree test suite: Add support for kmem_cache_free_bulk
On Wed, Apr 28, 2021 at 8:36 AM Liam Howlett <liam.howlett@...cle.com> wrote:
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> ---
> tools/testing/radix-tree/linux.c | 9 +++++++++
> tools/testing/radix-tree/linux/slab.h | 1 +
> 2 files changed, 10 insertions(+)
>
> diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
> index 93f7de81fbe8..380bbc0a48d6 100644
> --- a/tools/testing/radix-tree/linux.c
> +++ b/tools/testing/radix-tree/linux.c
> @@ -91,6 +91,15 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
> pthread_mutex_unlock(&cachep->lock);
> }
>
> +void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t size, void **list)
> +{
> + if (kmalloc_verbose)
> + printk("Bulk free %p[0-%lu]\n", list, size - 1);
nit: Printing the address of the "list" is meaningless IMHO unless you
output its value in kmem_cache_alloc_bulk, which you do not.
I would also suggest combining the patch introducing
kmem_cache_alloc_bulk with this one since they seem to be
compementary.
> +
> + for (int i = 0; i < size; i++)
> + kmem_cache_free(cachep, list[i]);
> +}
> +
> void *kmalloc(size_t size, gfp_t gfp)
> {
> void *ret;
> diff --git a/tools/testing/radix-tree/linux/slab.h b/tools/testing/radix-tree/linux/slab.h
> index 2958830ce4d7..53b79c15b3a2 100644
> --- a/tools/testing/radix-tree/linux/slab.h
> +++ b/tools/testing/radix-tree/linux/slab.h
> @@ -24,4 +24,5 @@ struct kmem_cache *kmem_cache_create(const char *name, unsigned int size,
> unsigned int align, unsigned int flags,
> void (*ctor)(void *));
>
> +void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t, void **);
> #endif /* SLAB_H */
> --
> 2.30.2
>
Powered by blists - more mailing lists