* + mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix.patch added to -mm tree
@ 2017-02-15 21:03 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-02-15 21:03 UTC (permalink / raw)
To: vbabka, cl, iamjoonsoo.kim, mawilcox, penberg, rientjes, mm-commits
The patch titled
Subject: mm, slab: rename kmalloc-node cache to kmalloc-<size>-fix2
has been added to the -mm tree. Its filename is
mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Vlastimil Babka <vbabka@suse.cz>
Subject: mm, slab: rename kmalloc-node cache to kmalloc-<size>-fix2
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@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/slab.c | 2 +-
mm/slab.h | 7 ++++++-
mm/slab_common.c | 10 +---------
3 files changed, 8 insertions(+), 11 deletions(-)
diff -puN mm/slab.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix mm/slab.c
--- a/mm/slab.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix
+++ a/mm/slab.c
@@ -1289,7 +1289,7 @@ void __init kmem_cache_init(void)
* structures first. Without this, further allocations will bug.
*/
kmalloc_caches[INDEX_NODE] = create_kmalloc_cache(
- get_kmalloc_cache_name(INDEX_NODE),
+ 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-fix-fix mm/slab.h
--- a/mm/slab.h~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix
+++ 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);
@@ -78,7 +84,6 @@ unsigned long calculate_alignment(unsign
/* Kmalloc array related functions */
void setup_kmalloc_cache_index_table(void);
void create_kmalloc_caches(unsigned long);
-const char *get_kmalloc_cache_name(int index);
/* Find the kmalloc slab corresponding for a certain size */
struct kmem_cache *kmalloc_slab(size_t, gfp_t);
diff -puN mm/slab_common.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix mm/slab_common.c
--- a/mm/slab_common.c~mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix
+++ 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},
@@ -935,11 +932,6 @@ static struct {
{"kmalloc-67108864", 67108864}
};
-const char *get_kmalloc_cache_name(int index)
-{
- return kmalloc_info[index].name;
-}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-15 21:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 21:03 + mm-slab-rename-kmalloc-node-cache-to-kmalloc-size-fix-fix.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.