Re: [PATCH v4 9/9] mm, slub: skip percpu sheaves for remote object freeing

2025-05-07 Thread Harry Yoo
On Fri, Apr 25, 2025 at 10:27:29AM +0200, Vlastimil Babka wrote: > Since we don't control the NUMA locality of objects in percpu sheaves, > allocations with node restrictions bypass them. Allocations without > restrictions may however still expect to get local objects with high > probability, and t

Re: [PATCH v4 3/9] slab: sheaf prefilling for guaranteed allocations

2025-05-07 Thread Harry Yoo
On Wed, May 07, 2025 at 06:15:34PM +0900, Harry Yoo wrote: > On Fri, Apr 25, 2025 at 10:27:23AM +0200, Vlastimil Babka wrote: > > Add functions for efficient guaranteed allocations e.g. in a critical > > section that cannot sleep, when the exact number of allocations is not >

Re: [PATCH v4 3/9] slab: sheaf prefilling for guaranteed allocations

2025-05-07 Thread Harry Yoo
ough oversize sheaves, but > there's a WARN_ON_ONCE() to indicate the omission. > > Signed-off-by: Vlastimil Babka > Reviewed-by: Suren Baghdasaryan > --- Looks good to me, Reviewed-by: Harry Yoo with a nit below. > +/* > + * Use this to return a sheaf obtained by km

Re: [PATCH v4 2/9] slab: add sheaf support for batching kfree_rcu() operations

2025-04-29 Thread Harry Yoo
CONFIG_KVFREE_RCU_BATCHED as the tiny > implementation favors smaller memory footprint over performance. > > Add CONFIG_SLUB_STATS counters free_rcu_sheaf and free_rcu_sheaf_fail to > count how many kfree_rcu() used the rcu_free sheaf successfully and how > many had to fall back to the ex

Re: [PATCH v4 1/9] slab: add opt-in caching layer of percpu sheaves

2025-04-28 Thread Harry Yoo
led for a cache with sheaf_capacity also > specified, the latter is ignored so that allocations and frees reach the > slow path where debugging hooks are processed. > > Signed-off-by: Vlastimil Babka > --- Reviewed-by: Harry Yoo LGTM, with a few nits: > include/linux/slab.h | 3

Re: [PATCH RFC v3 3/8] slab: add sheaf support for batching kfree_rcu() operations

2025-04-08 Thread Harry Yoo
struct slab_sheaf *spare; > + struct slab_sheaf *spare, *rcu_free; > > localtry_lock(&s->cpu_sheaves->lock); > pcs = this_cpu_ptr(s->cpu_sheaves); > @@ -2605,6 +2629,9 @@ static void pcs_flush_all(struct kmem_cache *s) > spare = pcs->spare; >

Re: [PATCH RFC v3 2/8] slab: add opt-in caching layer of percpu sheaves

2025-04-03 Thread Harry Yoo
On Mon, Mar 17, 2025 at 03:33:03PM +0100, Vlastimil Babka wrote: > Specifying a non-zero value for a new struct kmem_cache_args field > sheaf_capacity will setup a caching layer of percpu arrays called > sheaves of given capacity for the created cache. > > Allocations from the cache will allocate

Re: [PATCH RFC v2 07/10] slab: determine barn status racily outside of lock

2025-02-25 Thread Harry Yoo
can skip repeating > checks if there are too many sheaves on the given list as the limits > don't need to be strict. > > Signed-off-by: Vlastimil Babka Looks good to me, Reviewed-by: Harry Yoo in kmem_cache_return_sheaf: > if (!pcs->spare) {

Re: [PATCH RFC v2 06/10] slab: sheaf prefilling for guaranteed allocations

2025-02-25 Thread Harry Yoo
On Fri, Feb 14, 2025 at 05:27:42PM +0100, Vlastimil Babka wrote: > Add functions for efficient guaranteed allocations e.g. in a critical > section that cannot sleep, when the exact number of allocations is not > known beforehand, but an upper limit can be calculated. > > kmem_cache_prefill_sheaf()

Re: [PATCH RFC v2 06/10] slab: sheaf prefilling for guaranteed allocations

2025-02-24 Thread Harry Yoo
On Sat, Feb 22, 2025 at 07:54:16PM -0800, Suren Baghdasaryan wrote: > On Fri, Feb 14, 2025 at 8:27 AM Vlastimil Babka wrote: > > > > Add functions for efficient guaranteed allocations e.g. in a critical > > section that cannot sleep, when the exact number of allocations is not > > known beforehand

Re: [PATCH RFC v2 05/10] slab: switch percpu sheaves locking to localtry_lock

2025-02-24 Thread Harry Yoo
uce the locking (due to irq disabling/enabling) overhead. > Failing to use percpu sheaves in an irq due to preempting an already > locked user of sheaves should be rare so it's a favorable tradeoff. > > Signed-off-by: Vlastimil Babka Looks good to me, Reviewed-by: Harry Yoo

Re: [PATCH RFC v2 02/10] slab: add sheaf support for batching kfree_rcu() operations

2025-02-24 Thread Harry Yoo
On Fri, Feb 14, 2025 at 05:27:38PM +0100, Vlastimil Babka wrote: > Extend the sheaf infrastructure for more efficient kfree_rcu() handling. > For caches with sheaves, on each cpu maintain a rcu_free sheaf in > addition to main and spare sheaves. > > kfree_rcu() operations will try to put objects o

Re: [PATCH RFC v2 01/10] slab: add opt-in caching layer of percpu sheaves

2025-02-24 Thread Harry Yoo
On Fri, Feb 14, 2025 at 05:27:37PM +0100, Vlastimil Babka wrote: > Specifying a non-zero value for a new struct kmem_cache_args field > sheaf_capacity will setup a caching layer of percpu arrays called > sheaves of given capacity for the created cache. > > Allocations from the cache will allocate