Re: [PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-05-01 Thread Wei Yang
On Mon, May 01, 2017 at 07:39:30AM -0700, Matthew Wilcox wrote: >On Mon, May 01, 2017 at 04:20:05PM +0800, Wei Yang wrote: >> I have tried to replace the code with slub_cpu_partial(), it works fine on >> most of cases except two: >> >> 1. slub_cpu_partial(c) = page->next; > >New accessor: slub_set

Re: [PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-05-01 Thread Matthew Wilcox
On Mon, May 01, 2017 at 04:20:05PM +0800, Wei Yang wrote: > I have tried to replace the code with slub_cpu_partial(), it works fine on > most of cases except two: > > 1. slub_cpu_partial(c) = page->next; New accessor: slub_set_cpu_partial(c, p) > 2. page = READ_ONCE(slub_cpu_partial(c)); OK, th

Re: [PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-05-01 Thread Wei Yang
On Sun, Apr 30, 2017 at 07:41:03PM -0700, Matthew Wilcox wrote: >On Sun, Apr 30, 2017 at 07:31:51PM +0800, Wei Yang wrote: >> @@ -2302,7 +2302,11 @@ static bool has_cpu_slab(int cpu, void *info) >> struct kmem_cache *s = info; >> struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); >

Re: [PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-05-01 Thread Wei Yang
On Sun, Apr 30, 2017 at 07:41:03PM -0700, Matthew Wilcox wrote: >On Sun, Apr 30, 2017 at 07:31:51PM +0800, Wei Yang wrote: >> @@ -2302,7 +2302,11 @@ static bool has_cpu_slab(int cpu, void *info) >> struct kmem_cache *s = info; >> struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); >

Re: [PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-04-30 Thread Matthew Wilcox
On Sun, Apr 30, 2017 at 07:31:51PM +0800, Wei Yang wrote: > @@ -2302,7 +2302,11 @@ static bool has_cpu_slab(int cpu, void *info) > struct kmem_cache *s = info; > struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); > > - return c->page || c->partial; > + return c->page >

[PATCH 2/3] mm/slub: wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL

2017-04-30 Thread Wei Yang
cpu_slab's field partial is used when CONFIG_SLUB_CPU_PARTIAL is set, which means we can save a pointer's space on each cpu for every slub item. This patch wrap cpu_slab->partial in CONFIG_SLUB_CPU_PARTIAL and wrap its sysfs too. Signed-off-by: Wei Yang --- include/linux/slub_def.h | 2 ++ mm/