mm: fix new crash in unmapped_area_topdown()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / slab.h
index 34a98d642196f5e57e2bc2a1d94f7333b3ab7c48..4d6d836247dd95c3eb5e4d3e39295a80eb000a81 100644 (file)
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -16,7 +16,7 @@ enum slab_state {
        DOWN,                   /* No slab functionality yet */
        PARTIAL,                /* SLUB: kmem_cache_node available */
        PARTIAL_ARRAYCACHE,     /* SLAB: kmalloc size for arraycache available */
-       PARTIAL_L3,             /* SLAB: kmalloc size for l3 struct available */
+       PARTIAL_NODE,           /* SLAB: kmalloc size for node struct available */
        UP,                     /* Slab caches usable but not all extras yet */
        FULL                    /* Everything is working */
 };
@@ -35,6 +35,15 @@ extern struct kmem_cache *kmem_cache;
 unsigned long calculate_alignment(unsigned long flags,
                unsigned long align, unsigned long size);
 
+#ifndef CONFIG_SLOB
+/* Kmalloc array related functions */
+void create_kmalloc_caches(unsigned long);
+
+/* Find the kmalloc slab corresponding for a certain size */
+struct kmem_cache *kmalloc_slab(size_t, gfp_t);
+#endif
+
+
 /* Functions provided by the slab allocators */
 extern int __kmem_cache_create(struct kmem_cache *, unsigned long flags);
 
@@ -153,6 +162,8 @@ static inline const char *cache_name(struct kmem_cache *s)
 
 static inline struct kmem_cache *cache_from_memcg(struct kmem_cache *s, int idx)
 {
+       if (!s->memcg_params)
+               return NULL;
        return s->memcg_params->memcg_caches[idx];
 }
 
@@ -230,3 +241,35 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
        return s;
 }
 #endif
+
+
+/*
+ * The slab lists for all objects.
+ */
+struct kmem_cache_node {
+       spinlock_t list_lock;
+
+#ifdef CONFIG_SLAB
+       struct list_head slabs_partial; /* partial list first, better asm code */
+       struct list_head slabs_full;
+       struct list_head slabs_free;
+       unsigned long free_objects;
+       unsigned int free_limit;
+       unsigned int colour_next;       /* Per-node cache coloring */
+       struct array_cache *shared;     /* shared per node */
+       struct array_cache **alien;     /* on other nodes */
+       unsigned long next_reap;        /* updated without locking */
+       int free_touched;               /* updated without locking */
+#endif
+
+#ifdef CONFIG_SLUB
+       unsigned long nr_partial;
+       struct list_head partial;
+#ifdef CONFIG_SLUB_DEBUG
+       atomic_long_t nr_slabs;
+       atomic_long_t total_objects;
+       struct list_head full;
+#endif
+#endif
+
+};