* [PATCH] slub: reduce duplicate creation on the first object
@ 2014-06-24 8:08 Wei Yang
0 siblings, 0 replies; only message in thread
From: Wei Yang @ 2014-06-24 8:08 UTC (permalink / raw)
To: clameter, cl, akpm, linux-mm, linux-kernel; +Cc: Wei Yang
When a kmem_cache is created with ctor, each object in the kmem_cache will be
initialized before ready to use. While in slub implementation, the first
object will be initialized twice.
This patch reduces the duplication of initialization of the first object.
Fix commit 7656c72b: SLUB: add macros for scanning objects in a slab.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index b2b0473..beefd45 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1433,7 +1433,7 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
memset(start, POISON_INUSE, PAGE_SIZE << order);
last = start;
- for_each_object(p, s, start, page->objects) {
+ for_each_object(p, s, start + s->size, page->objects - 1) {
setup_object(s, page, last);
set_freepointer(s, last, p);
last = p;
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-24 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 8:08 [PATCH] slub: reduce duplicate creation on the first object Wei Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).