From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by kanga.kvack.org (Postfix) with ESMTP id 431186B003C for ; Mon, 2 Dec 2013 03:47:30 -0500 (EST) Received: by mail-pb0-f41.google.com with SMTP id jt11so18570546pbb.28 for ; Mon, 02 Dec 2013 00:47:29 -0800 (PST) Received: from LGEMRELSE6Q.lge.com (LGEMRELSE6Q.lge.com. [156.147.1.121]) by mx.google.com with ESMTP id pj7si14074286pbc.99.2013.12.02.00.47.27 for ; Mon, 02 Dec 2013 00:47:29 -0800 (PST) From: Joonsoo Kim Subject: [PATCH v3 5/5] slab: make more slab management structure off the slab Date: Mon, 2 Dec 2013 17:49:43 +0900 Message-Id: <1385974183-31423-6-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1385974183-31423-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1385974183-31423-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Pekka Enberg Cc: Christoph Lameter , Andrew Morton , David Rientjes , Wanpeng Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Joonsoo Kim Now, the size of the freelist for the slab management diminish, so that the on-slab management structure can waste large space if the object of the slab is large. Consider a 128 byte sized slab. If on-slab is used, 31 objects can be in the slab. The size of the freelist for this case would be 31 bytes so that 97 bytes, that is, more than 75% of object size, are wasted. In a 64 byte sized slab case, no space is wasted if we use on-slab. So set off-slab determining constraint to 128 bytes. Acked-by: Christoph Lameter Signed-off-by: Joonsoo Kim diff --git a/mm/slab.c b/mm/slab.c index 7fab788..1a7f19d 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2264,7 +2264,7 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) * it too early on. Always use on-slab management when * SLAB_NOLEAKTRACE to avoid recursive calls into kmemleak) */ - if ((size >= (PAGE_SIZE >> 3)) && !slab_early_init && + if ((size >= (PAGE_SIZE >> 5)) && !slab_early_init && !(flags & SLAB_NOLEAKTRACE)) /* * Size is large, assume best to place the slab management obj -- 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: email@kvack.org