Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343802

[PATCH v2 01/17] mm/slab: fix stale code comment

From js1304@gmail.com
Newsgroups linux.kernel
Subject [PATCH v2 01/17] mm/slab: fix stale code comment
Date 2016-02-26 07:10 +0100
Message-ID <r6jLc-7pr-17@gated-at.bofh.it> (permalink)
References <r6jLb-7pr-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Joonsoo Kim <iamjoonsoo.kim@lge.com>

This patchset implements new freed object management way, that is,
OBJFREELIST_SLAB.  Purpose of it is to reduce memory overhead in SLAB.

SLAB needs a array to manage freed objects in a slab.  If there is
leftover after objects are packed into a slab, we can use it as a
management array, and, in this case, there is no memory waste.  But, in
the other cases, we need to allocate extra memory for a management array
or utilize dedicated internal memory in a slab for it.  Both cases causes
memory waste so it's not good.

With this patchset, freed object itself can be used for a management
array.  So, memory waste could be reduced.  Detailed idea and numbers are
described in last patch's commit description.  Please refer it.

In fact, I tested another idea implementing OBJFREELIST_SLAB with
extendable linked array through another freed object.  It can remove
memory waste completely but it causes more computational overhead in
critical lock path and it seems that overhead outweigh benefit.  So, this
patchset doesn't include it.  I will attach prototype just for a
reference.

This patch (of 16):

We use freelist_idx_t type for free object management whose size would be
smaller than size of unsigned int.  Fix it.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
 mm/slab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index b3eca03..23fc4b0 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -537,7 +537,7 @@ static void cache_estimate(unsigned long gfporder, size_t buffer_size,
 	 * on it. For the latter case, the memory allocated for a
 	 * slab is used for:
 	 *
-	 * - One unsigned int for each object
+	 * - One freelist_idx_t for each object
 	 * - Padding to respect alignment of @align
 	 * - @buffer_size bytes for each object
 	 *
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/17] mm/slab: introduce new freed objects management way, OBJFREELIST_SLAB js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 16/17] mm/slab: introduce new slab management type, OBJFREELIST_SLAB js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 16/17] mm/slab: introduce new slab management type,  OBJFREELIST_SLAB Christoph Lameter <cl@linux.com> - 2016-02-26 17:30 +0100
      Re: [PATCH v2 16/17] mm/slab: introduce new slab management type, OBJFREELIST_SLAB Joonsoo Kim <js1304@gmail.com> - 2016-02-26 18:10 +0100
  [PATCH v2 11/17] mm/slab: clean up cache type determination js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 03/17] mm/slab: remove the checks for slab implementation bug js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 03/17] mm/slab: remove the checks for slab implementation  bug Christoph Lameter <cl@linux.com> - 2016-02-26 17:10 +0100
  [PATCH v2 01/17] mm/slab: fix stale code comment js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 04/17] mm/slab: activate debug_pagealloc in SLAB when it is actually enabled js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 04/17] mm/slab: activate debug_pagealloc in SLAB when  it is actually enabled Christoph Lameter <cl@linux.com> - 2016-02-26 17:10 +0100
  [PATCH v2 05/17] mm/slab: use more appropriate condition check for debug_pagealloc js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 05/17] mm/slab: use more appropriate condition check  for debug_pagealloc Christoph Lameter <cl@linux.com> - 2016-02-26 17:10 +0100
  [PATCH v2 09/17] mm/slab: put the freelist at the end of slab page js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 07/17] mm/slab: alternative implementation for DEBUG_SLAB_LEAK js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 13/17] mm/slab: make criteria for off slab determination robust and simple js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 12/17] mm/slab: do not change cache size if debug pagealloc isn't possible js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 12/17] mm/slab: do not change cache size if debug  pagealloc isn't possible Christoph Lameter <cl@linux.com> - 2016-02-26 17:20 +0100
      Re: [PATCH v2 12/17] mm/slab: do not change cache size if debug  pagealloc isn't possible Joonsoo Kim <js1304@gmail.com> - 2016-02-26 18:10 +0100
  [PATCH v2 17/17] mm/slab: avoid returning values by reference js1304@gmail.com - 2016-02-26 07:10 +0100
    Re: [PATCH v2 17/17] mm/slab: avoid returning values by reference Christoph Lameter <cl@linux.com> - 2016-02-26 17:30 +0100
  [PATCH v2 06/17] mm/slab: clean up DEBUG_PAGEALLOC processing code js1304@gmail.com - 2016-02-26 07:10 +0100
  [PATCH v2 08/17] mm/slab: remove object status buffer for DEBUG_SLAB_LEAK js1304@gmail.com - 2016-02-26 07:10 +0100

csiph-web