Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Joonsoo Kim
2014-12-17 0:48 GMT+09:00 Christoph Lameter : > On Tue, 16 Dec 2014, Jesper Dangaard Brouer wrote: > >> > Ok but now there is a multiplication in the fast path. >> >> Could we pre-calculate the value (page->objects * s->size) and e.g store it >> in struct kmem_cache, thus saving the imul ? > > I th

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Christoph Lameter
On Tue, 16 Dec 2014, Jesper Dangaard Brouer wrote: > > Ok but now there is a multiplication in the fast path. > > Could we pre-calculate the value (page->objects * s->size) and e.g store it > in struct kmem_cache, thus saving the imul ? I think I just used the last available field for the page->a

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Andrey Ryabinin
2014-12-16 18:15 GMT+03:00 Jesper Dangaard Brouer : > On Tue, 16 Dec 2014 08:53:08 -0600 (CST) > Christoph Lameter wrote: > >> On Tue, 16 Dec 2014, Joonsoo Kim wrote: >> >> > > Like this: >> > > >> > > return d > 0 && d < page->objects * s->size; >> > > >> > >> > Yes! That's what I'm looki

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Andrey Ryabinin
2014-12-16 17:53 GMT+03:00 Christoph Lameter : > On Tue, 16 Dec 2014, Joonsoo Kim wrote: > >> > Like this: >> > >> > return d > 0 && d < page->objects * s->size; >> > >> >> Yes! That's what I'm looking for. >> Christoph, how about above change? > > Ok but now there is a multiplication in th

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Jesper Dangaard Brouer
On Tue, 16 Dec 2014 08:53:08 -0600 (CST) Christoph Lameter wrote: > On Tue, 16 Dec 2014, Joonsoo Kim wrote: > > > > Like this: > > > > > > return d > 0 && d < page->objects * s->size; > > > > > > > Yes! That's what I'm looking for. > > Christoph, how about above change? > > Ok but now t

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Christoph Lameter
On Tue, 16 Dec 2014, Joonsoo Kim wrote: > > Like this: > > > > return d > 0 && d < page->objects * s->size; > > > > Yes! That's what I'm looking for. > Christoph, how about above change? Ok but now there is a multiplication in the fast path. -- To unsubscribe from this list: send the lin

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Jesper Dangaard Brouer
On Tue, 16 Dec 2014 11:54:12 +0400 Andrey Ryabinin wrote: > 2014-12-16 5:42 GMT+03:00 Joonsoo Kim : > > On Mon, Dec 15, 2014 at 08:16:00AM -0600, Christoph Lameter wrote: > >> On Mon, 15 Dec 2014, Joonsoo Kim wrote: > >> > >> > > +static bool same_slab_page(struct kmem_cache *s, struct page *page

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-16 Thread Joonsoo Kim
On Tue, Dec 16, 2014 at 11:54:12AM +0400, Andrey Ryabinin wrote: > 2014-12-16 5:42 GMT+03:00 Joonsoo Kim : > > On Mon, Dec 15, 2014 at 08:16:00AM -0600, Christoph Lameter wrote: > >> On Mon, 15 Dec 2014, Joonsoo Kim wrote: > >> > >> > > +static bool same_slab_page(struct kmem_cache *s, struct page

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-15 Thread Andrey Ryabinin
2014-12-16 5:42 GMT+03:00 Joonsoo Kim : > On Mon, Dec 15, 2014 at 08:16:00AM -0600, Christoph Lameter wrote: >> On Mon, 15 Dec 2014, Joonsoo Kim wrote: >> >> > > +static bool same_slab_page(struct kmem_cache *s, struct page *page, >> > > void *p) >> > > +{ >> > > + long d = p - page->address; >> >

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-15 Thread Joonsoo Kim
On Mon, Dec 15, 2014 at 08:16:00AM -0600, Christoph Lameter wrote: > On Mon, 15 Dec 2014, Joonsoo Kim wrote: > > > > +static bool same_slab_page(struct kmem_cache *s, struct page *page, void > > > *p) > > > +{ > > > + long d = p - page->address; > > > + > > > + return d > 0 && d < (1 << MAX_ORDER

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-15 Thread Christoph Lameter
On Mon, 15 Dec 2014, Joonsoo Kim wrote: > > +static bool same_slab_page(struct kmem_cache *s, struct page *page, void > > *p) > > +{ > > + long d = p - page->address; > > + > > + return d > 0 && d < (1 << MAX_ORDER) && d < (compound_order(page) << > > PAGE_SHIFT); > > +} > > + > > Somtimes,

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-15 Thread Joonsoo Kim
On Wed, Dec 10, 2014 at 10:30:20AM -0600, Christoph Lameter wrote: > Avoid using the page struct address on free by just doing an > address comparison. That is easily doable now that the page address > is available in the page struct and we already have the page struct > address of the object to be

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-11 Thread Christoph Lameter
On Thu, 11 Dec 2014, Jesper Dangaard Brouer wrote: > If I explicitly add "inline", then it gets inlined, and performance is good > again. Ok adding inline for the next release. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-11 Thread Jesper Dangaard Brouer
On Wed, 10 Dec 2014 11:37:56 -0600 (CST) Christoph Lameter wrote: [...] > > There were some other issues so its now: > > > Subject: slub: Do not use c->page on free > > Avoid using the page struct address on free by just doing an > address comparison. That is easily doable now that the page

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-10 Thread Christoph Lameter
On Wed, 10 Dec 2014, Pekka Enberg wrote: > I'm fine with the optimization: > > Reviewed-by: Pekka Enberg There were some other issues so its now: Subject: slub: Do not use c->page on free Avoid using the page struct address on free by just doing an address comparison. That is easily doable no

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-10 Thread Pekka Enberg
On Wed, Dec 10, 2014 at 7:08 PM, Christoph Lameter wrote: >> > +{ >> > + long d = p - page->address; >> > + >> > + return d > 0 && d < (1 << MAX_ORDER) && d < (compound_order(page) >> > << PAGE_SHIFT); >> > +} >> >> Can you elaborate on what this is doing? I don't really understand it

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-10 Thread Christoph Lameter
On Wed, 10 Dec 2014, Pekka Enberg wrote: > > +static bool same_slab_page(struct kmem_cache *s, struct page *page, void > > *p) > > Why are you passing a pointer to struct kmem_cache here? You don't > seem to use it. True. > > +{ > > + long d = p - page->address; > > + > > + return d

Re: [PATCH 3/7] slub: Do not use c->page on free

2014-12-10 Thread Pekka Enberg
On Wed, Dec 10, 2014 at 6:30 PM, Christoph Lameter wrote: > Avoid using the page struct address on free by just doing an > address comparison. That is easily doable now that the page address > is available in the page struct and we already have the page struct > address of the object to be freed c

[PATCH 3/7] slub: Do not use c->page on free

2014-12-10 Thread Christoph Lameter
Avoid using the page struct address on free by just doing an address comparison. That is easily doable now that the page address is available in the page struct and we already have the page struct address of the object to be freed calculated. Signed-off-by: Christoph Lameter Index: linux/mm/slub