Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Matthew Wilcox
On Wed, Mar 03, 2021 at 08:15:58PM +0100, Christoph Lameter wrote: > On Wed, 3 Mar 2021, Matthew Wilcox wrote: > > > On Tue, Mar 02, 2021 at 10:14:53AM +0100, Christoph Lameter wrote: > > > On Mon, 10 Aug 2020, Xunlei Pang wrote: > > > > - atomic_long_t partial_free_objs; > > > > +

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Matthew Wilcox
On Wed, Mar 03, 2021 at 08:55:48PM +0100, Christoph Lameter wrote: > On Wed, 3 Mar 2021, Matthew Wilcox wrote: > > > > Can this be allocated in an interrupt context? > > > > > > And I am not sure how local_t relates to that? Percpu counters can be used > > > in an interrupt context without the

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Christoph Lameter
On Wed, 3 Mar 2021, Matthew Wilcox wrote: > > Can this be allocated in an interrupt context? > > > > And I am not sure how local_t relates to that? Percpu counters can be used > > in an interrupt context without the overhead of the address calculations > > that are required by a local_t. > > As I

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Christoph Lameter
On Wed, 3 Mar 2021, Matthew Wilcox wrote: > On Tue, Mar 02, 2021 at 10:14:53AM +0100, Christoph Lameter wrote: > > On Mon, 10 Aug 2020, Xunlei Pang wrote: > > > - atomic_long_t partial_free_objs; > > > + atomic_long_t __percpu *partial_free_objs; > > > > A percpu counter is never atomic. Just use

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Matthew Wilcox
On Tue, Mar 02, 2021 at 10:14:53AM +0100, Christoph Lameter wrote: > On Mon, 10 Aug 2020, Xunlei Pang wrote: > > - atomic_long_t partial_free_objs; > > + atomic_long_t __percpu *partial_free_objs; > > A percpu counter is never atomic. Just use unsigned long and use this_cpu > operations for

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-03 Thread Xunlei Pang
On 3/2/21 5:14 PM, Christoph Lameter wrote: > On Mon, 10 Aug 2020, Xunlei Pang wrote: > >> >> diff --git a/mm/slab.h b/mm/slab.h >> index c85e2fa..a709a70 100644 >> --- a/mm/slab.h >> +++ b/mm/slab.h >> @@ -616,7 +616,7 @@ struct kmem_cache_node { >> #ifdef CONFIG_SLUB >> unsigned long

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-02 Thread Christoph Lameter
On Mon, 10 Aug 2020, Xunlei Pang wrote: > > diff --git a/mm/slab.h b/mm/slab.h > index c85e2fa..a709a70 100644 > --- a/mm/slab.h > +++ b/mm/slab.h > @@ -616,7 +616,7 @@ struct kmem_cache_node { > #ifdef CONFIG_SLUB > unsigned long nr_partial; > struct list_head partial; > -

Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter

2021-03-02 Thread Shu Ming
On Mon, Aug 10, 2020 at 8:22 PM Xunlei Pang wrote: > static inline void > @@ -2429,12 +2439,12 @@ static unsigned long partial_counter(struct > kmem_cache_node *n, > unsigned long ret = 0; > > if (item == PARTIAL_FREE) { > - ret =