Re: [PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
On Fri, 19 Oct 2012, Ezequiel Garcia wrote: > Fields object_size and size are not the same: the latter might include > slab metadata. Return object_size field in kmem_cache_size(). > Also, improve trace accuracy by correctly tracing reported size. Acked-by: Christoph Lameter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Cc: Christoph Lameter Cc: Pekka Enberg Cc: Matt Mackall Acked-by: David Rientjes Signed-off-by: Ezequiel Garcia --- mm/slob.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 06a5ec7..287a88a 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -554,12 +554,12 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) if (c->size < PAGE_SIZE) { b = slob_alloc(c->size, flags, c->align, node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, SLOB_UNITS(c->size) * SLOB_UNIT, flags, node); } else { b = slob_new_pages(flags, get_order(c->size), node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, PAGE_SIZE << get_order(c->size), flags, node); } @@ -606,7 +606,7 @@ EXPORT_SYMBOL(kmem_cache_free); unsigned int kmem_cache_size(struct kmem_cache *c) { - return c->size; + return c->object_size; } EXPORT_SYMBOL(kmem_cache_size); -- 1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Cc: Christoph Lameter c...@linux-foundation.org Cc: Pekka Enberg penb...@kernel.org Cc: Matt Mackall m...@selenic.com Acked-by: David Rientjes rient...@google.com Signed-off-by: Ezequiel Garcia elezegar...@gmail.com --- mm/slob.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 06a5ec7..287a88a 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -554,12 +554,12 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) if (c-size PAGE_SIZE) { b = slob_alloc(c-size, flags, c-align, node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c-size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c-object_size, SLOB_UNITS(c-size) * SLOB_UNIT, flags, node); } else { b = slob_new_pages(flags, get_order(c-size), node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c-size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c-object_size, PAGE_SIZE get_order(c-size), flags, node); } @@ -606,7 +606,7 @@ EXPORT_SYMBOL(kmem_cache_free); unsigned int kmem_cache_size(struct kmem_cache *c) { - return c-size; + return c-object_size; } EXPORT_SYMBOL(kmem_cache_size); -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
On Fri, 19 Oct 2012, Ezequiel Garcia wrote: Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Acked-by: Christoph Lameter c...@linux.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
On Thu, 18 Oct 2012, Ezequiel Garcia wrote: > Fields object_size and size are not the same: the latter might include > slab metadata. Return object_size field in kmem_cache_size(). > Also, improve trace accuracy by correctly tracing reported size. > > Cc: Christoph Lameter > Cc: Pekka Enberg > Cc: Matt Mackall > Signed-off-by: Ezequiel Garcia Acked-by: David Rientjes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Cc: Christoph Lameter Cc: Pekka Enberg Cc: Matt Mackall Signed-off-by: Ezequiel Garcia --- mm/slob.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 06a5ec7..287a88a 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -554,12 +554,12 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) if (c->size < PAGE_SIZE) { b = slob_alloc(c->size, flags, c->align, node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, SLOB_UNITS(c->size) * SLOB_UNIT, flags, node); } else { b = slob_new_pages(flags, get_order(c->size), node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, PAGE_SIZE << get_order(c->size), flags, node); } @@ -606,7 +606,7 @@ EXPORT_SYMBOL(kmem_cache_free); unsigned int kmem_cache_size(struct kmem_cache *c) { - return c->size; + return c->object_size; } EXPORT_SYMBOL(kmem_cache_size); -- 1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Cc: Christoph Lameter c...@linux-foundation.org Cc: Pekka Enberg penb...@kernel.org Cc: Matt Mackall m...@selenic.com Signed-off-by: Ezequiel Garcia elezegar...@gmail.com --- mm/slob.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 06a5ec7..287a88a 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -554,12 +554,12 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) if (c-size PAGE_SIZE) { b = slob_alloc(c-size, flags, c-align, node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c-size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c-object_size, SLOB_UNITS(c-size) * SLOB_UNIT, flags, node); } else { b = slob_new_pages(flags, get_order(c-size), node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c-size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c-object_size, PAGE_SIZE get_order(c-size), flags, node); } @@ -606,7 +606,7 @@ EXPORT_SYMBOL(kmem_cache_free); unsigned int kmem_cache_size(struct kmem_cache *c) { - return c-size; + return c-object_size; } EXPORT_SYMBOL(kmem_cache_size); -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] mm/slob: Use object_size field in kmem_cache_size()
On Thu, 18 Oct 2012, Ezequiel Garcia wrote: Fields object_size and size are not the same: the latter might include slab metadata. Return object_size field in kmem_cache_size(). Also, improve trace accuracy by correctly tracing reported size. Cc: Christoph Lameter c...@linux-foundation.org Cc: Pekka Enberg penb...@kernel.org Cc: Matt Mackall m...@selenic.com Signed-off-by: Ezequiel Garcia elezegar...@gmail.com Acked-by: David Rientjes rient...@google.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/