[merged] mm-slab-rename-kmalloc-node-cache-to-kmalloc-size.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm, slab: rename kmalloc-node cache to kmalloc-<size>
has been removed from the -mm tree.  Its filename was
     mm-slab-rename-kmalloc-node-cache-to-kmalloc-size.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Vlastimil Babka <vbabka@xxxxxxx>
Subject: mm, slab: rename kmalloc-node cache to kmalloc-<size>

SLAB as part of its bootstrap pre-creates one kmalloc cache that can fit the
kmem_cache_node management structure, and puts it into the generic kmalloc
cache array (e.g. for 128b objects). The name of this cache is "kmalloc-node",
which is confusing for readers of /proc/slabinfo as the cache is used for
generic allocations (and not just the kmem_cache_node struct) and it appears as
the kmalloc-128 cache is missing.

An easy solution is to use the kmalloc-<size> name when pre-creating the cache,
which we can get from the kmalloc_info array.

Example /proc/slabinfo before the patch:

...
kmalloc-256         1647   1984    256   16    1 : tunables  120   60    8 : slabdata    124    124    828
kmalloc-192         1974   1974    192   21    1 : tunables  120   60    8 : slabdata     94     94    133
kmalloc-96          1332   1344    128   32    1 : tunables  120   60    8 : slabdata     42     42    219
kmalloc-64          2505   5952     64   64    1 : tunables  120   60    8 : slabdata     93     93    715
kmalloc-32          4278   4464     32  124    1 : tunables  120   60    8 : slabdata     36     36    346
kmalloc-node        1352   1376    128   32    1 : tunables  120   60    8 : slabdata     43     43     53
kmem_cache           132    147    192   21    1 : tunables  120   60    8 : slabdata      7      7      0

After the patch:

...
kmalloc-256         1672   2160    256   16    1 : tunables  120   60    8 : slabdata    135    135    807
kmalloc-192         1992   2016    192   21    1 : tunables  120   60    8 : slabdata     96     96    203
kmalloc-96          1159   1184    128   32    1 : tunables  120   60    8 : slabdata     37     37    116
kmalloc-64          2561   4864     64   64    1 : tunables  120   60    8 : slabdata     76     76    785
kmalloc-32          4253   4340     32  124    1 : tunables  120   60    8 : slabdata     35     35    270
kmalloc-128         1256   1280    128   32    1 : tunables  120   60    8 : slabdata     40     40     39
kmem_cache           125    147    192   21    1 : tunables  120   60    8 : slabdata      7      7      0

[vbabka@xxxxxxx: export the whole kmalloc_info structure instead of just a name accessor, per Christoph Lameter]
  Link: http://lkml.kernel.org/r/54e80303-b814-4232-66d4-95b34d3eb9d0@xxxxxxx
Link: http://lkml.kernel.org/r/20170203181008.24898-1-vbabka@xxxxxxx
Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
Reviewed-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/slab.c        |    3 ++-
 mm/slab.h        |    6 ++++++
 mm/slab_common.c |    5 +----
 3 files changed, 9 insertions(+), 5 deletions(-)

diff -puN mm/slab.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size mm/slab.c
--- a/mm/slab.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size
+++ a/mm/slab.c
@@ -1288,7 +1288,8 @@ void __init kmem_cache_init(void)
 	 * Initialize the caches that provide memory for the  kmem_cache_node
 	 * structures first.  Without this, further allocations will bug.
 	 */
-	kmalloc_caches[INDEX_NODE] = create_kmalloc_cache("kmalloc-node",
+	kmalloc_caches[INDEX_NODE] = create_kmalloc_cache(
+				kmalloc_info[INDEX_NODE].name,
 				kmalloc_size(INDEX_NODE), ARCH_KMALLOC_FLAGS);
 	slab_state = PARTIAL_NODE;
 	setup_kmalloc_cache_index_table();
diff -puN mm/slab.h~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size mm/slab.h
--- a/mm/slab.h~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size
+++ a/mm/slab.h
@@ -71,6 +71,12 @@ extern struct list_head slab_caches;
 /* The slab cache that manages slab cache information */
 extern struct kmem_cache *kmem_cache;
 
+/* A table of kmalloc cache names and sizes */
+extern const struct kmalloc_info_struct {
+	const char *name;
+	unsigned long size;
+} kmalloc_info[];
+
 unsigned long calculate_alignment(unsigned long flags,
 		unsigned long align, unsigned long size);
 
diff -puN mm/slab_common.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size mm/slab_common.c
--- a/mm/slab_common.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size
+++ a/mm/slab_common.c
@@ -915,10 +915,7 @@ struct kmem_cache *kmalloc_slab(size_t s
  * kmalloc_index() supports up to 2^26=64MB, so the final entry of the table is
  * kmalloc-67108864.
  */
-static struct {
-	const char *name;
-	unsigned long size;
-} const kmalloc_info[] __initconst = {
+const struct kmalloc_info_struct kmalloc_info[] __initconst = {
 	{NULL,                      0},		{"kmalloc-96",             96},
 	{"kmalloc-192",           192},		{"kmalloc-8",               8},
 	{"kmalloc-16",             16},		{"kmalloc-32",             32},
_

Patches currently in -mm which might be from vbabka@xxxxxxx are

mm-page_alloc-remove-redundant-checks-from-alloc-fastpath.patch
mm-page_alloc-dont-check-cpuset-allowed-twice-in-fast-path.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux