Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Vlastimil Babka
On 6/28/24 5:47 PM, Kees Cook wrote: > On Thu, Jun 27, 2024 at 10:35:36PM -0700, Boqun Feng wrote: >> On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote: >> > Rust people were asking about kmalloc alignment (but I forgot the details) >> >> It was me! The ask is whether we can specify

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Kees Cook
On Thu, Jun 27, 2024 at 10:35:36PM -0700, Boqun Feng wrote: > On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote: > > Rust people were asking about kmalloc alignment (but I forgot the details) > > It was me! The ask is whether we can specify the alignment for the > allocation API, for

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Alice Ryhl
On Fri, Jun 28, 2024 at 11:17 AM Vlastimil Babka wrote: > > On 6/28/24 11:06 AM, Alice Ryhl wrote: > >> >> > >> > > >> > I took a quick look as what kmem_buckets is, and seems to me that align > >> > doesn't make sense here (and probably not useful in Rust as well) > >> > because a kmem_buckets is

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Vlastimil Babka
On 6/28/24 11:06 AM, Alice Ryhl wrote: >> >> >> > >> > I took a quick look as what kmem_buckets is, and seems to me that align >> > doesn't make sense here (and probably not useful in Rust as well) >> > because a kmem_buckets is a set of kmem_caches, each has its own object >> > size, making them s

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Alice Ryhl
On Fri, Jun 28, 2024 at 10:40 AM Vlastimil Babka wrote: > > On 6/28/24 7:35 AM, Boqun Feng wrote: > > On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote: > >> On 6/20/24 8:54 PM, Kees Cook wrote: > >> > On Thu, Jun 20, 2024 at 03:56:27PM +0200, Vlastimil Babka wrote: > >> >> > @@ -549

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-28 Thread Vlastimil Babka
On 6/28/24 7:35 AM, Boqun Feng wrote: > On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote: >> On 6/20/24 8:54 PM, Kees Cook wrote: >> > On Thu, Jun 20, 2024 at 03:56:27PM +0200, Vlastimil Babka wrote: >> >> > @@ -549,6 +549,11 @@ void *kmem_cache_alloc_lru_noprof(struct >> >> > kmem_

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-27 Thread Boqun Feng
On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote: > On 6/20/24 8:54 PM, Kees Cook wrote: > > On Thu, Jun 20, 2024 at 03:56:27PM +0200, Vlastimil Babka wrote: > >> > @@ -549,6 +549,11 @@ void *kmem_cache_alloc_lru_noprof(struct kmem_cache > >> > *s, struct list_lru *lru, > >> > > >

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-20 Thread Kees Cook
On Thu, Jun 20, 2024 at 03:48:24PM -0700, Andi Kleen wrote: > Kees Cook writes: > > > Dedicated caches are available for fixed size allocations via > > kmem_cache_alloc(), but for dynamically sized allocations there is only > > the global kmalloc API's set of buckets available. This means it isn'

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-20 Thread Andi Kleen
Kees Cook writes: > Dedicated caches are available for fixed size allocations via > kmem_cache_alloc(), but for dynamically sized allocations there is only > the global kmalloc API's set of buckets available. This means it isn't > possible to separate specific sets of dynamically sized allocation

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-20 Thread Vlastimil Babka
On 6/20/24 8:54 PM, Kees Cook wrote: > On Thu, Jun 20, 2024 at 03:56:27PM +0200, Vlastimil Babka wrote: >> > @@ -549,6 +549,11 @@ void *kmem_cache_alloc_lru_noprof(struct kmem_cache >> > *s, struct list_lru *lru, >> > >> > void kmem_cache_free(struct kmem_cache *s, void *objp); >> > >> > +kme

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-20 Thread Kees Cook
On Thu, Jun 20, 2024 at 03:56:27PM +0200, Vlastimil Babka wrote: > On 6/19/24 9:33 PM, Kees Cook wrote: > > Dedicated caches are available for fixed size allocations via > > kmem_cache_alloc(), but for dynamically sized allocations there is only > > the global kmalloc API's set of buckets available

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-06-20 Thread Vlastimil Babka
On 6/19/24 9:33 PM, Kees Cook wrote: > Dedicated caches are available for fixed size allocations via > kmem_cache_alloc(), but for dynamically sized allocations there is only > the global kmalloc API's set of buckets available. This means it isn't > possible to separate specific sets of dynamically